Repository navigation
Terminal: system copy/paste shortcuts; Escape or a Stop button interrupts a command (#721) - #727
Merged
Merged
Conversation
…rupts (#721) Ctrl+C/Cmd+C copies the terminal's selection, Ctrl+V pastes (multi-line paste unchanged), Ctrl+A selects the terminal and Ctrl+X copies: attachShortcuts leaves them to the engine instead of xterm.js's control characters. \x03 no longer clears the line nor interrupts a command. A command is interrupted by Escape (with no selection; Escape clears a selection) or by the Stop button, in the floating window's bar or over the terminal's corner. The interruption itself is unchanged (signal aborted, 130, webfront.commands.cancel, grace period, status interrupted); its messages say "interrupted". Specs of the keys and of the editor (terminal-specs.mjs); the integration specs interrupt through the editor's Escape and the Stop button, and press real keys in CEF (DevTools Input.dispatchKeyEvent) for copy, paste, select all and Escape. Docs, help texts, Commands.hpp comments and the changelog follow; packages.bundle.mjs and bundles.json are refreshed, the pin is unchanged.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
AM-L
approved these changes
Nov 28, 2026
This was referenced Nov 28, 2026
…minal # Conflicts: # docs/CHANGELOG.md # js/developer/environment/bundles.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #721.
Why
In the developer environment's terminal, xterm.js turned Ctrl+C into
\x03, which the line editor used to clear the line or interrupt the running command, and Ctrl+V into\x16: the system's copy and paste, which the engine's context menu advertises, did nothing from the keyboard. Ctrl+C was also not a reliable stop gesture in the embedded windows.What changes
terminal.mjs,attachShortcuts, wired inruntime.mjs): Ctrl+C/⌘C copies the selection, Ctrl+V/⌘V pastes, Ctrl+A/⌘A selects the whole terminal, Ctrl+X/⌘X copies (nothing of the terminal can be cut). The custom key handler leaves them to the engine; xterm.js fills the clipboard oncopyand gives the paste toonData, so a multi-line paste still runs line by line. The selection is also staged in xterm.js's textarea andbeforecopy/beforecutare cancelled while a selection exists, so engines whose Copy depends on a page selection (a native Edit menu, as WKWebView's) enable it. Shift is allowed (Ctrl+Shift+C), Alt is not (AltGr); the letter comes from the layout, or fromcodefor non-Latin layouts.\x03no longer clears the line nor interrupts. The mechanics are unchanged:context.signalaborted, exit code 130,webfront.commands.cancelfor C++ commands, the scripts' grace period, statusinterrupted. Messages sayTests interrupted/Script x interruptedinstead ofstopped by Ctrl+C; the editor printsInterruptedinstead of^C.wf dev's message,wf helpand the terminal'shelp,Commands.hppcomments,README*.md,docs/DEVELOPER_ENVIRONMENT.md(new System shortcuts and Interruption items; Home is no longer Ctrl+A),docs/DEVELOPING_WITH_AGENTS.md,docs/TEST_TIERS.md, the changelog. The@webfront/ptyadapter is out of scope and unchanged.distribution.json1.2.2, header pinned on 1.2.1 since Advance developer environment sources to 1.2.2 #719), so the pin is unchanged.packages.bundle.mjs(which bundlesscripts.mjs) andbundles.jsonare refreshed withwf run build build-distribution --refresh-bootstrap, keeping the pinned header and its checksum.Tests
test/developer/specs/terminal-specs.mjs(new, real xterm.js): Ctrl+C/⌘C on a selection sends no\x03, leaves the event to the engine and the copy fills the clipboard; Ctrl+X copies; Ctrl+A selects the terminal and not the page; Ctrl+V pastes multi-line text as before; Escape clears a selection, otherwise reaches the editor; without a selection Ctrl+C leaves the line;\x03neither clears the line nor interrupts; Escape andinterrupt()(the button) stop a command with 130 and drop the keys typed ahead, also when typed during a pending completion. A control spec shows the same synthetic key sends\x03without the handler.DeveloperBrowserIntegration: the interruptions ofwf dev,wf run,wf check,wf testand the C++ commands go through the line editor's Escape; the terminal part presses Escape through xterm.js on a C++ command, uses the Stop button (over the corner) onwf run coop, and, on CEF, presses real keys (DevToolsInput.dispatchKeyEventfrom the test program): copy a line with Ctrl+C, clear with Escape, paste it with Ctrl+V, select all with Ctrl+A, interrupt a command with Escape. The workspace part stops a command with the Stop button of the floating window's bar.wf testof the environment (442 specs),ctest -L web-integrationon the CEF build (all pass;WebFrontBrowserIntegration,CEFLifecycle-navigation-allow-listandDeveloperBrowserIntegration-workspacefailed once under a load average of 22 and passed when rerun).