Skip to content
Open
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
5 changes: 5 additions & 0 deletions apps/web/src/terminal/ghostty/surface.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ describe("isTerminalPasteShortcut", () => {
expect(isTerminalPasteShortcut(event({ ctrlKey: true }), "MacIntel")).toBe(false);
});

it("uses Ctrl+V on Windows", () => {
expect(isTerminalPasteShortcut(event({ ctrlKey: true }), "Win32")).toBe(true);
expect(isTerminalPasteShortcut(event({ metaKey: true }), "Win32")).toBe(false);
});

it("preserves Ctrl+V and uses Ctrl+Shift+V elsewhere", () => {
expect(isTerminalPasteShortcut(event({ ctrlKey: true }), "Linux x86_64")).toBe(false);
expect(isTerminalPasteShortcut(event({ ctrlKey: true, shiftKey: true }), "Linux x86_64")).toBe(
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/terminal/ghostty/surface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isMacPlatform } from "../../lib/utils";
import { isMacPlatform, isWindowsPlatform } from "../../lib/utils";
import { collectWrappedTerminalLinkLine, extractTerminalLinks } from "../../terminal-links";
import {
GhosttyTerminalCore,
Expand Down Expand Up @@ -345,7 +345,9 @@ export function isTerminalPasteShortcut(
return event.shiftKey && !event.ctrlKey && !event.metaKey;
}
if (key !== "v") return false;
return isMacPlatform(platform) ? event.metaKey : event.ctrlKey && event.shiftKey;
if (isMacPlatform(platform)) return event.metaKey;
if (isWindowsPlatform(platform)) return event.ctrlKey;
return event.ctrlKey && event.shiftKey;
}

export function isTerminalCompositionCommitInput(event: Pick<InputEvent, "inputType">): boolean {
Expand Down
Loading