fix(terminal): use ctrl shift c for output copy
Capture Ctrl+Shift+C before xterm input handling and copy selected output through a browser-compatible fallback. Preserve Ctrl+C as terminal input.
This commit is contained in:
@@ -33,25 +33,28 @@ describe("getTerminalScrollbackLimit", () => {
|
||||
});
|
||||
|
||||
describe("shouldCopyTerminalSelection", () => {
|
||||
it("copies a selected terminal region with Ctrl+C or Cmd+C", () => {
|
||||
it("copies a selected terminal region with Ctrl+Shift+C", () => {
|
||||
expect(
|
||||
shouldCopyTerminalSelection(
|
||||
{ ctrlKey: true, metaKey: false, key: "c" },
|
||||
true,
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
shouldCopyTerminalSelection(
|
||||
{ ctrlKey: false, metaKey: true, key: "C" },
|
||||
{ ctrlKey: true, shiftKey: true, key: "c" },
|
||||
true,
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps Ctrl+C as a terminal interrupt without a selection", () => {
|
||||
it("keeps Ctrl+C as a terminal interrupt", () => {
|
||||
expect(
|
||||
shouldCopyTerminalSelection(
|
||||
{ ctrlKey: true, metaKey: false, key: "c" },
|
||||
{ ctrlKey: true, shiftKey: false, key: "c" },
|
||||
true,
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not copy without a selection", () => {
|
||||
expect(
|
||||
shouldCopyTerminalSelection(
|
||||
{ ctrlKey: true, shiftKey: true, key: "c" },
|
||||
false,
|
||||
),
|
||||
).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user