Skip to content

feat(terminal): add search images and prompt navigation - #2147

Merged
houko merged 1 commit into
mainfrom
feat/terminal-search-images-1461
Nov 23, 2026
Merged

houko merged 1 commit into
mainfrom
feat/terminal-search-images-1461

Conversation

@houko

@houko houko commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

Terminal search now paints configured match backgrounds and foregrounds before text and cursor. Kitty graphics are accepted by default with a bounded image store and rendered from cached premultiplied pixels, including PNG, source crops, z ordering, replacement/deletion, synchronized updates, scrolling and Unicode placeholders. OSC 133 semantic prompt phases gate Option/Alt click cursor movement across wrapped graphemes and wide cells.

Verification

  • go tool nsgo test ./base/terminal — 62 passed, 3 skips (2 existing platform/helper skips and the new native pixel test when headless)
  • go tool nsgo check -target macos,ios,windows,linux,android,web,tvos,watchos -jobs 4 — all targets vetted
  • go tool nsgo test -target macos -activate -run "TestOptionClickPrompt|TestTerminalGraphicsPixels|TestTerminalGraphicsPlaceholders" — native 3 passed
  • module layering, skills, driver hooks and duplicate-platform gates passed

Native proof screenshots are in the test output for Option-click, search plus images, and Unicode placeholders. Browser integration needs the pinned semantic prompt callback foreign-type adaptations from #2144 (opt42 allowlist and foreignType case).

Relative image placements rooted in Unicode virtual placements remain a documented roadmap goal because the pinned placement API exposes no viewport origin for them. Native normal relative placements, normal images and Unicode placeholders use the shared renderer on every supported backend.

Integration notes for the parallel terminal PRs: retain one native_test.go; retain the CellWide helper from #2141; #2142 mouse capture must bypass Alt-only left clicks accepted by promptDistance; #2145 contrast handling must use the effective search background/foreground. With #2144, register cbSemanticPrompt with signature viii, read its request with foreignValue[semanticPrompt], add optSemanticPrompt to the scalar callback allowlist, and map semanticPrompt to GhosttyTerminalSemanticPrompt in foreignType.

Closes #1461.

@github-actions github-actions Bot added enhancement New feature or request size/XL documentation Improvements or additions to documentation base tsx and removed size/XL labels Nov 22, 2026
@houko

houko commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. Checked the new GhosttyTerminalSemanticPrompt layout is validated against the manifest like the other callback structs, that Option-click only moves within the current OSC 133 input (rechecked on release, cancelled by drags and outside releases, and sent as one encoded burst of arrow keys), that Kitty images stay bounded by Options.ImageLimit (64 MiB default, disabled when negative), and that search colors are painted under glyphs and the cursor.

Rebased onto main: squashed the two commits first (the second only renamed graphics.go to images.go, which collided with main's new box-drawing graphics.go), kept main's minimum-contrast step and applied the search foreground after it, kept CursorBlink beside the new ImageLimit in tsx, moved the CHANGELOG.md bullet into changelog.d/terminal-search-images-1461.md, and unwrapped the hard-wrapped comments. vet (linux, darwin, windows) and -race tests for base/terminal and tsx/terminal pass on Linux; changelog check passes. #2144 will need to adapt to the new semantic prompt callback when it is rebased.

@houko
houko force-pushed the feat/terminal-search-images-1461 branch from 50de6cb to 5d2f141 Compare November 23, 2026 00:09
@houko
houko merged commit 21f5d35 into main Nov 23, 2026
@houko
houko deleted the feat/terminal-search-images-1461 branch November 23, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base documentation Improvements or additions to documentation enhancement New feature or request size/XL tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal: Search, images and shell integration

1 participant