fix(run): select and copy the whole console output with Select All (#903)

Root cause: Cmd/Ctrl+A in the Run console fell through to the browser and selected the whole window, and copying only saw the rows the virtualizer had mounted. Select All now selects the console only (also in its context menu), and copying after it — keyboard, context menu or native copy — takes the whole buffer. copySelectionOnKeyDown accepts a textOf callback for other views that do not mount all their text.

Refs #746

Co-authored-by: ntbang0901 <[email protected]>
Цей коміт міститься в:
ntbang0901 authored and GitHub committed 2026-11-02 23:41:21 +08:00
1 джерело b3c0efd804
коміт 7c7d656a50
4 files changed
+88 -4

No files matched your search

+3 -1
Переглянути файл
@@ -70,6 +70,8 @@ export function copySelectionOnKeyDown(
| "preventDefault"
| "stopPropagation"
>,
/** Text to copy instead of `selection.toString()`, for views that do not mount all their text. */
textOf: (selection: Selection) => string = (selection) => selection.toString(),
): boolean {
if (e.defaultPrevented || e.nativeEvent.isComposing || e.altKey || e.shiftKey) return false;
const copy =
@@ -87,6 +89,6 @@ export function copySelectionOnKeyDown(
return false;
e.preventDefault();
e.stopPropagation();
void copyText(selection.toString());
void copyText(textOf(selection));
return true;
}