GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(web): configure terminal copy and paste shortcuts by fionn77 · Pull Request #26836 · pingdotgg/t3code

feat(web): configure terminal copy and paste shortcuts #26836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fionn77 wants to merge 10 commits into pingdotgg:main
base: main
Loading
Loading
from fionn77:feat/terminal-clipboard-keybindings
+146 −29
Open

feat(web): configure terminal copy and paste shortcuts #26836

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit Hold shift + click to select a range
07f25bd
feat(web): configure terminal copy and paste shortcuts
fionn77 Oct 29, 2026
1324888
fix(web): preserve native terminal paste shortcuts
maria-rcks Nov 1, 2026
27b6837
fix(web): retain native terminal copy fallback
maria-rcks Nov 1, 2026
d839a20
Merge origin/main into feat/terminal-clipboard-keybindings
juliusmarminge Nov 17, 2026
fba2873
fix(web): route Alt-modified clipboard chords through configured actions
juliusmarminge Nov 17, 2026
1416db8
refactor(web): share layout-aware terminal clipboard matchers from ke…
juliusmarminge Nov 17, 2026
5d63a7d
Merge origin/main into feat/terminal-clipboard-keybindings
fionn77 Nov 20, 2026
4a8d326
test(web): cover Alt-modified Insert clipboard chords
fionn77 Nov 20, 2026
5039deb
Merge origin/main into feat/terminal-clipboard-keybindings
fionn77 Nov 27, 2026
41ec448
feat(web): label terminal copy and paste in keybinding settings
fionn77 Nov 27, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(web): retain native terminal copy fallback
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@maria-rcks
maria-rcks committed Nov 1, 2026
commit 27b6837298b7330d6753815034c771c1f58209c8

Some comments aren't visible on the classic Files Changed page.

There are no files selected for viewing

9 changes: 8 additions & 1 deletion 9 apps/web/src/components/ThreadTerminalDrawer.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import {
} from "~/lib/selectionActions";
import {
GhosttyTerminalSurface,
isTerminalPasteShortcut,
type GhosttyTerminalSurfaceOptions,
} from "~/terminal/ghostty/surface";
import { isEditableFocused } from "~/lib/editableFocus";
Expand All @@ -65,7 +64,9 @@ import { isTerminalUrl } from "../terminal-links";
import {
isDiffToggleShortcut,
isTerminalClearShortcut,
isTerminalCopyShortcut,
isTerminalNewShortcut,
isTerminalPasteShortcut,
isTerminalSplitShortcut,
isTerminalSplitVerticalShortcut,
isTerminalToggleShortcut,
Expand Down Expand Up @@ -964,6 +965,12 @@ function TerminalSessionViewport({
const clipboardCommand = resolveShortcutCommand(event, currentKeybindings, options);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

if (clipboardCommand === "terminal.copy" || clipboardCommand === "terminal.paste") {
if (clipboardCommand === "terminal.paste" && isTerminalPasteShortcut(event)) return true;
if (
clipboardCommand === "terminal.copy" &&
terminalRef.current?.hasSelection() &&
isTerminalCopyShortcut(event)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

)
return true;
event.preventDefault();
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

event.stopPropagation();
clearSelectionAction();
Expand Down
24 changes: 24 additions & 0 deletions 24 apps/web/src/keybindings.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,30 @@ export function isRichTextBoldShortcut(
);
}

export function isTerminalCopyShortcut(
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
platform = navigator.platform,
) {
const key = event.key.toLowerCase();
if (key === "insert" && !isMacPlatform(platform)) {
return event.ctrlKey && !event.shiftKey && !event.metaKey;
}
if (key !== "c") return false;
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey;
}

export function isTerminalPasteShortcut(
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
platform = navigator.platform,
) {
const key = event.key.toLowerCase();
if (key === "insert" && !isMacPlatform(platform)) {
return event.shiftKey && !event.ctrlKey && !event.metaKey;
}
if (key !== "v") return false;
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey && event.shiftKey;
}

export function isTerminalClearShortcut(
event: ShortcutEventLike,
platform = navigator.platform,
Expand Down
27 changes: 3 additions & 24 deletions 27 apps/web/src/terminal/ghostty/surface.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
import symbolsFontUrl from "./fonts/SymbolsNerdFontMono-Regular.woff2?url";
import { isMonospaceFamily } from "../../appearanceFonts";
import { observeResize } from "../../lib/observeResize";
import { isTerminalCopyShortcut, isTerminalPasteShortcut } from "../../keybindings";

export { isTerminalCopyShortcut } from "../../keybindings";

const DEFAULT_TERMINAL_FONT_SIZE = 12;
const MIN_TERMINAL_FONT_SIZE = 6;
Expand Down Expand Up @@ -296,18 +299,6 @@ export function terminalLinkAtPositionWithRange(
return null;
}

export function isTerminalCopyShortcut(
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
platform = navigator.platform,
) {
const key = event.key.toLowerCase();
if (key === "insert" && !isMacPlatform(platform)) {
return event.ctrlKey && !event.shiftKey && !event.metaKey;
}
if (key !== "c") return false;
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey;
}

/** Primes native and Electron menu copy from the focused textarea; canvas has no DOM selection. */
export function primeTerminalCopyInput(
input: Pick<HTMLTextAreaElement, "value" | "select">,
Expand Down Expand Up @@ -338,18 +329,6 @@ export function applyTerminalCopyEvent(
return { preventDefault: true, claimWriteFallback: true };
}

export function isTerminalPasteShortcut(
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
platform = navigator.platform,
) {
const key = event.key.toLowerCase();
if (key === "insert" && !isMacPlatform(platform)) {
return event.shiftKey && !event.ctrlKey && !event.metaKey;
}
if (key !== "v") return false;
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey && event.shiftKey;
}

// X11/Wayland expects middle-click paste; macOS and Windows use it for autoscroll.
function isMiddleClickPastePlatform(): boolean {
return /linux|bsd/i.test(navigator.platform);
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.