Repository navigation
Conversation
The desktop terminal had no way to search its output. A find bar now opens over the terminal tab and searches the scrollback through xterm's search addon: every match is highlighted and counted, Enter and Shift+Enter step through them, and Aa / .* toggle case and regex. A one-line selection seeds the query, highlights follow new output, and Esc hands the keyboard back to the shell. Bare Ctrl+F still reaches the shell as ^F on Windows and Linux. Find also works on a tab whose session has ended. addon-search 0.16 records new options before comparing them with the last ones, so a case/regex/theme change never re-highlights; the bar drops the addon's cached query when they change. Match highlighting uses registerDecoration, which xterm 6 still gates behind allowProposedApi.
sachin56
force-pushed
the
feat/gui-terminal-search
branch
from
October 9, 2026 22:27
608dd1e to
bf78743
Compare
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.
Problem
The desktop terminal has no way to search its output. Finding an error in a long log or build output means scrolling the scrollback by eye.
Solution
A find bar over the terminal tab, using xterm's official search addon (
@xterm/addon-search0.16, the release that pairs with@xterm/xterm6).less).onWriteParsed).terminalTheme.tsbeside the xterm theme, derived from--status-warn, and follow the theme toggle.Two things a reviewer may want to know about:
allowProposedApi: trueis now set on the terminal. Highlighting usesregisterDecoration, which xterm 6 still gates as proposed API. Without it, every search with highlights throws.findNextstores the new options beforeshouldUpdateHighlightingcompares them with the previous ones, so toggling case or regex (or the theme's colours) never re-highlights. The bar callsclearDecorations()when those change, which drops the addon's cached term and forces a fresh pass.The current match shows as the terminal selection plus an outline rather than a solid fill. The addon also selects the match, and the selection is painted over the decoration. VS Code's terminal looks the same.
Changes
screens/TerminalFind.svelte: the find bar (new)screens/terminalFind.ts: count label and selection seeding, kept pure for tests (new)screens/terminalInput.ts:isFindShortcut, with the same non-Latin-layout physical-key handling asisCopyShortcutscreens/TerminalView.svelte: loads the addon, routes the shortcut, focus hand-offtheme/terminalTheme.ts:searchColours(the addon only accepts#RRGGBB, so the colours can't be CSS tokens)CHANGELOG.md(Unreleased → Features),README.md(Real terminals)No Rust changes.
Test plan
npm run check: 0 errors, 0 warningsnpm test: all pass, including new unit tests forisFindShortcut, the count label, selection seeding and the highlight coloursnpx playwright test: all 141 pass. New e2e cases ine2e/terminal.spec.tscover:^Fcargo tauri devon macOS (Intel): ⌘F opens the bar, highlights and stepping work against a live SSH session