Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/mobile/src/components/ui/AppSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import IconMoodPlus from "@tabler/icons-react-native/IconMoodPlus";
import IconTag from "@tabler/icons-react-native/IconTag";
import IconTicket from "@tabler/icons-react-native/IconTicket";
import IconClock from "@tabler/icons-react-native/IconClock";
import IconClipboard from "@tabler/icons-react-native/IconClipboard";
import IconCode from "@tabler/icons-react-native/IconCode";
import IconCopy from "@tabler/icons-react-native/IconCopy";
import IconDatabase from "@tabler/icons-react-native/IconDatabase";
Expand Down Expand Up @@ -306,6 +307,7 @@ const ANDROID_ICON_BY_MATERIAL_NAME = {
close: IconX,
construction: IconHammer,
content_copy: IconCopy,
content_paste: IconClipboard,
desktop_windows: IconDeviceDesktop,
edit: IconEdit,
error: IconAlertCircle,
Expand Down
19 changes: 11 additions & 8 deletions apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class TerminalClipboardReadError extends Schema.TaggedError<TerminalClipboardRea
type TerminalToolbarAction =
| { readonly kind: "send"; readonly key: string; readonly label: string; readonly data: string }
| { readonly kind: "clear"; readonly key: string; readonly label: string }
| { readonly kind: "paste"; readonly key: string; readonly label: string }
| {
readonly kind: "modifier";
readonly key: string;
Expand Down Expand Up @@ -582,7 +581,6 @@ function ThreadTerminal(props: {
{ kind: "send", key: "esc", label: "esc", data: "\u001b" },
...modifierActions,
{ kind: "send", key: "tab", label: "tab", data: "\t" },
{ kind: "paste", key: "paste", label: "paste" },
{ kind: "clear", key: "clear", label: "clear" },
{ kind: "send", key: "tilde", label: "~", data: "~" },
{ kind: "send", key: "pipe", label: "|", data: "|" },
Expand Down Expand Up @@ -796,15 +794,14 @@ function ThreadTerminal(props: {
return;
}

if (action.kind === "paste") {
setPendingModifier(null);
void pasteFromClipboard();
return;
}

writeModifiedInput(action.data);
};

const handlePaste = () => {
setPendingModifier(null);
void pasteFromClipboard();
};

const handleDismissKeyboard = () => {
setAccessory((current) => ({ ...current, dismissed: true }));
void KeyboardController.dismiss();
Expand Down Expand Up @@ -1044,6 +1041,12 @@ function ThreadTerminal(props: {
);
})}
</ComposerToolbarScroller>
<ComposerToolbarButton
accessibilityLabel="Paste"
icon={{ ios: "doc.on.clipboard", android: "content_paste" }}
onPress={handlePaste}
showChevron={false}
/>
<ComposerToolbarButton
accessibilityLabel="Dismiss keyboard"
icon={{ ios: "keyboard.chevron.compact.down", android: "keyboard_hide" }}
Expand Down
Loading