Add terminal graphics protocol support and fullscreen preview#3
Merged
Conversation
## Summary - Add detection of terminal graphics protocols (Kitty, iTerm2, WezTerm, Ghostty) with automatic fallback to half-block rendering - `--screenshot` now displays the captured image inline in the terminal using the native graphics protocol at full terminal size - New `f` key in the TUI to view screenshots fullscreen — temporarily exits alt-screen, renders the image using the native protocol, and returns on any keypress ## Details Graphics protocols (Kitty/iTerm2) can't be used inside Bubbletea's alt-screen mode because the escape sequences break the panel layout. The approach taken: - **TUI panels**: always use half-block (safe, works everywhere) - **Fullscreen mode (`f`)**: pauses Bubbletea via `tea.Exec`, exits alt-screen, renders with native protocol, waits for keypress, resumes TUI - **CLI `--screenshot`**: renders inline using native protocol at full terminal size ## Test plan - [ ] Run `--screenshot <preview>` in Kitty/iTerm2/WezTerm — image should render at full terminal size with native quality - [ ] Run `--screenshot <preview>` in a basic terminal — should fallback to half-block - [ ] In TUI, capture a screenshot with `s`, then press `f` — should show fullscreen image, any key returns - [ ] Verify `f fullscreen` appears in the help bar - [ ] Verify panels are not broken in normal TUI mode
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.
Summary
--screenshotnow displays the captured image inline in the terminal using the native graphics protocol at full terminal sizefkey in the TUI to view screenshots fullscreen — temporarily exits alt-screen, renders the image using the native protocol, and returns on any keypressDetails
Graphics protocols (Kitty/iTerm2) can't be used inside Bubbletea's alt-screen mode because the escape sequences break the panel layout. The approach taken:
f): pauses Bubbletea viatea.Exec, exits alt-screen, renders with native protocol, waits for keypress, resumes TUI--screenshot: renders inline using native protocol at full terminal sizeTest plan
--screenshot <preview>in Kitty/iTerm2/WezTerm — image should render at full terminal size with native quality--screenshot <preview>in a basic terminal — should fallback to half-blocks, then pressf— should show fullscreen image, any key returnsf fullscreenappears in the help bar