Repository navigation
terminal: xterm addons (unicode11, web-links, search) and a find bar (#131) - #134
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Unicode 11 width tables, clickable URLs and search, vendored from the same xterm 5.3.0 release as public/vendor/xterm.js. The find bar opens with Ctrl+Shift+F (Cmd+F on macOS) or from the pane menu, searches incrementally, steps on Enter / Shift+Enter and closes on Esc. Loading unicode11 alone does nothing, so the pane also activates it.
1d7eaa5 to
18cb887
Compare
💡 Codex Reviewhttps://github.com/Lexus2016/claude-code-studio/blob/1d7eaa5ba515892934f6c189b1f24511abbe8f4c/public/index.html#L19734 When a user clicks any menu item, its https://github.com/Lexus2016/claude-code-studio/blob/1d7eaa5ba515892934f6c189b1f24511abbe8f4c/public/index.html#L19936-L19937 On macOS, Cmd+V now calls ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Second slice of #131: the pane gets the three addons it was missing, and a way to search
the scrollback.
What landed
public/vendornow holds the addon bundles next toxterm.js, the same wayxterm-addon-fit.jsalready did. All four come from the 5.3.0 release, which is theversion of the vendored
xterm.js—public/vendor/xterm.jsis byte-identical toxterm@5.3.0/lib/xterm.js, so the addons are the matching builds and not a newer API onan older core.
xterm-addon-unicode11.js@xterm/addon-unicode11@0.7.0xterm-addon-web-links.js@xterm/addon-web-links@0.10.0xterm-addon-search.js@xterm/addon-search@0.14.0The files are the package's own UMD bundles (
lib/addon-*.js), copied unchanged —sha256of each equals the extracted npm tarball.electron-builder.ymlalready ships**/*, so nothing else is needed for the desktop build._createTerminalloads them throughtermAddonPlan(), which takes the bundle globals andreturns only the ones that exist: a checkout (or a packaged build) that lost one vendor
file keeps the pane it has instead of throwing before
xterm.open().unicode11 is activated, not just loaded —
term.unicode.activeVersion = '11'. Theaddon registers its width tables and does nothing until they are the active version; that
one line is the whole fix for the misaligned TUI the issue reported.
web-links gets our own handler. The default opens the URL with
window.open, which inthe desktop build is already routed to the system browser by
applyWindowOpenPolicy, butthe handler now also refuses anything that is not
http(s), so a future provider cannotmake the pane open
file://orjavascript:.The find bar
Ctrl+Shift+F(orCmd+Fon macOS) inside the pane, and a Find… item in the pane'sright-click menu, open a row above the terminal:
Entersteps forward,Shift+Enterback, both non-incremental;3 of 12,1000 of 1000+at the addon's highlight cap, andNo matchesotherwise;
Esccloses the bar, clears the decorations and hands the keyboard back to the pane;count from a hidden pane can no longer write into it;
and leave a band of blank rows.
Plain
Ctrl+Fis deliberately not the pane's: it is readline'sforward-charforwhatever is running inside, and the chat's own
Ctrl+Fsearch is bound where focus isoutside the pane. Seven new strings in all five dictionaries.
Verification
Real Chromium, against the vendored files (headless shell, the page's own
_createTerminaland find block, the real keyboard path):term.unicode.activeVersionis11,versionsis['6', '11'];Ctrl+Shift+Fpressed inside the pane opens the bar and focuses the field;needleover 40 matching lines reports1 of 40,Entergives2 of 40, a querywith no match reads
No matches;Esccloses it, clears the field, and tworesizeframes went out (open and close);https://example.com/x;Unit —
test/terminal-addons.test.js(new, 21 checks): the three vendored bundles areevaluated as the
<script>tag evaluates them and must expose their constructors; the plandrops a missing bundle; only
http(s)leaves through the link handler; the chords, thecount label, the incremental/step/clear calls, Esc, the per-session result filter and the
"no addon, no bar" path are all run against a fake xterm.
test/terminal-clipboard.test.jsgained the menu's Find item and now evaluates the new block, since
_createTerminalcallsinto it.
Still open in #131
clipboardandwebgl: both change rendering and need a wider check on the embeddedElectron build;
selection, pinch-to-zoom, 80-column floor, prompt buttons on
input_needed).