Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(terminal): restore copying from Claude Code’s fullscreen TUI #9949

Closedcallmemorgan(GitHub profile, opens in a new tab)wants to merge 16 commits intomain fromrefs/pull/9949/headopened View on GitHub

Showing 15 changed files with 67 additions and 0 deletions (loading 13).

x
0 of 15 viewed, 15 left
2 additions and 0 deletionsapps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsxModified
View file
@@ -75,6 +75,7 @@
type PendingModifier,
} from "./terminalInput";
import { createTerminalPasteSession } from "./terminalPaste";
+import { useTerminalClipboard } from "./useTerminalClipboard";
import { cacheTerminalGridSize, getCachedTerminalGridSize } from "./terminalUiState";
​
const DEFAULT_TERMINAL_COLS = 80;
@@ -335,6 +336,7 @@
const terminalKey = selectedThread
? `${selectedThread.environmentId}:${selectedThread.id}:${terminalId}`
: terminalId;
+ useTerminalClipboard(selectedThread?.environmentId ?? null, terminalAttachInput);
const bufferReplayKey = useMemo(
() => getTerminalBufferReplayKey({ terminalKey, fontSize }),
[fontSize, terminalKey],
65 additions and 0 deletionsapps/mobile/src/features/terminal/useTerminalClipboard.tsAdded
View file
@@ -0,0 +1,65 @@
+import { useFocusEffect } from "@react-navigation/native";
+import { environmentRpcKey } from "@t3tools/client-runtime/state/runtime";
+import {
+ createTerminalClipboardSession,
+ createTerminalClipboardWriter,
+} from "@t3tools/client-runtime/terminal-clipboard";
+import type { EnvironmentId, TerminalAttachInput } from "@t3tools/contracts";
+import * as Clipboard from "expo-clipboard";
+import { useCallback, useLayoutEffect, useMemo, useRef } from "react";