Terminal find, font zoom, and copy/paste keybindings¶
Motivation¶
The browser terminal lacked the everyday ergonomics of a native terminal: there was no way to search scrollback, adjust the font size, click a URL, or use familiar copy/paste shortcuts. Phase 2 closes that gap so a researcher can work in the browser terminal the way they would in a local one.
User-facing change¶
- Find in buffer: a "Find" toolbar button (or
Ctrl/Cmd+Shift+F) opens a search overlay that highlights matches in the scrollback as you type. - Font zoom: toolbar
−/ size /+controls, plusCtrl/Cmd +,Ctrl/Cmd -, andCtrl/Cmd 0(reset), resize the terminal font between 9 and 28 px without triggering browser page zoom. - Clickable links: URLs in terminal output are now clickable.
- Copy/paste shortcuts:
Ctrl/Cmd+Shift+Ccopies the current selection andCtrl/Cmd+Shift+Vpastes, matching common Linux-terminal muscle memory. The existing right-click and select-to-copy behaviour is unchanged.
Implementation¶
- web/src/pages/RemoteTerminal.tsx:
loads
@xterm/addon-searchand@xterm/addon-web-links;syncTerminalResizeis shared by theResizeObserverand the font-zoom path;applyTerminalFontSize/adjustTerminalFontSizeclamp toTERMINAL_FONT_MIN/MAX.attachCustomKeyEventHandlerhandles every shortcut withevent.preventDefault()so the browser default (page zoom, hidden-textarea paste) never fires. - web/src/theme/glass.css:
.terminal-toolbar,.terminal-font-controls, and.terminal-searchstyles;.terminal-framebecomesposition: relativeto anchor the search overlay. - web/package.json: adds
@xterm/addon-searchand@xterm/addon-web-links.
Validation¶
cd web && npm run build— passes;npx eslint src/pages/RemoteTerminal.tsx— clean.cd web && npm test -- --run— 581 passed.