The best way to control Claude Code, Codex and more from any computer or phone
fix(web): support Shift+Insert terminal paste (#5982)
aoright committed
Aug 15, 2026 at 20:02 UTC
b0de3857775b7d1407372cde031326e15a9d4119
2 files changed
+21
-1
apps/web/src/terminal/ghostty/surface.test.ts
+16
@@ -253,6 +253,22 @@ describe("isTerminalPasteShortcut", () => {
253
true,
254
);
255
});
256
+
257
+ it("supports the conventional Shift+Insert paste shortcut", () => {
258
+ expect(isTerminalPasteShortcut(event({ key: "Insert", shiftKey: true }), "Linux x86_64")).toBe(
259
+ true,
260
+ );
261
+ expect(isTerminalPasteShortcut(event({ key: "Insert" }), "Linux x86_64")).toBe(false);
262
+ expect(
263
+ isTerminalPasteShortcut(
264
+ event({ key: "Insert", ctrlKey: true, shiftKey: true }),
265
+ "Linux x86_64",
266
+ ),
267
+ ).toBe(false);
268
+ expect(isTerminalPasteShortcut(event({ key: "Insert", shiftKey: true }), "MacIntel")).toBe(
269
+ false,
270
+ );
271
+ });
272
});
273
274
describe("isTerminalCompositionCommitInput", () => {
apps/web/src/terminal/ghostty/surface.ts
+5
-1
@@ -340,7 +340,11 @@ export function isTerminalPasteShortcut(
340
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
341
platform = navigator.platform,
342
) {
343
- if (event.key.toLowerCase() !== "v") return false;
343
+ const key = event.key.toLowerCase();
344
+ if (key === "insert" && !isMacPlatform(platform)) {
345
+ return event.shiftKey && !event.ctrlKey && !event.metaKey;
346
+ }
347
+ if (key !== "v") return false;
348
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey && event.shiftKey;
349
}
350