Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): copy terminal selection with Ctrl+Insert #8541

Mergediamshadmantaqi(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/8541/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 22 additions and 4 deletions.

x
0 of 2 viewed, 2 left
14 additions and 0 deletionsapps/web/src/terminal/ghostty/surface.test.tsModified
View file
@@ -556,6 +556,20 @@
expect(isTerminalCopyShortcut(event({ key: "C", metaKey: true }), "MacIntel")).toBe(true);
expect(isTerminalCopyShortcut(event({ key: "j", metaKey: true }), "MacIntel")).toBe(false);
});
+​
+ it("supports the conventional Ctrl+Insert copy shortcut", () => {
+ expect(isTerminalCopyShortcut(event({ key: "Insert", ctrlKey: true }), "Linux x86_64")).toBe(
+ true,
+ );
+ expect(isTerminalCopyShortcut(event({ key: "Insert" }), "Linux x86_64")).toBe(false);
+ expect(
+ isTerminalCopyShortcut(
+ event({ key: "Insert", ctrlKey: true, shiftKey: true }),
+ "Linux x86_64",
+ ),
+ ).toBe(false);
+ expect(isTerminalCopyShortcut(event({ key: "Insert", ctrlKey: true }), "MacIntel")).toBe(false);
+ });
});
​
describe("applyTerminalCopyEvent", () => {
8 additions and 4 deletionsapps/web/src/terminal/ghostty/surface.tsModified
View file
@@ -321,7 +321,11 @@
event: Pick<KeyboardEvent, "ctrlKey" | "key" | "metaKey" | "shiftKey">,
platform = navigator.platform,
) {
- if (event.key.toLowerCase() !== "c") return false;