fix(console): Ctrl+C copies selected output in consoles and terminals (#381)

On Windows and Linux, Ctrl+C in the Run/Debug consoles and other DOM output views did nothing because no handler copied the selection. Each output view (Run and Debug consoles, Build output and message detail, Git console, database output, Docker logs) now copies its own selection on Ctrl+C / Ctrl+Insert (Cmd+C on macOS) through a shared helper, leaving views with their own copy handling (database grid, Problems) untouched. In terminals, Ctrl+C copies a selection on Windows and Linux and otherwise interrupts; on macOS it always interrupts. The console menu shows the host's copy shortcut.

Not verified on a real Windows machine.

Fixes #372
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-30 17:53:31 +08:00
1 джерело 932ac379bc
коміт d837cb1acb
14 files changed
+506 -13

No files matched your search

+2
Переглянути файл
@@ -1,4 +1,5 @@
/** Debug tool window: toolbar, Threads & Variables (frames + variables), Console. */
import { copySelectionOnKeyDown } from "@/ui/selectableText";
import { useEffect, useMemo, useRef, useState, type KeyboardEvent } from "react";
import clsx from "clsx";
import { executeAction, getAction } from "@/platform/actions";
@@ -621,6 +622,7 @@ function ConsoleView({ session }: { session: DebugSession }) {
showContextMenu(e, [{ label: "Clear All", icon: "trash", run: () => clearConsole(session.id) }]);
}}
role="log"
onKeyDown={copySelectionOnKeyDown}
aria-label={tx("Debug console")}
tabIndex={0}
>