Repository navigation
Conversation
Controls reports whether a stream is a terminal that acts on escape sequences, independent of the color mode: TERM=dumb is refused, and on Windows virtual terminal processing is switched on even with --color=never or NO_COLOR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Package tui builds full-screen applications from widgets: lists and tables that filter as you type and mark rows, a one-line input with readline keys, undo and suggestions, a multi-line editor, switches, checkboxes, radio groups, check lists, selects, buttons and forms, dialogs, menus and prompts, panels, boxes, pages and tabs, a scrolling and searchable viewport, a key legend, a help screen and a status bar. The App takes the terminal over (raw mode, alternate screen, bracketed paste, optional mouse), redraws only the cells that changed, and puts the terminal back on quit, panic and signals; it suspends on request and picks resizes up through SIGWINCH. Keys go from the focused widget up the tree to the application's keymap, and a widget that takes text gets characters first. Work that blocks runs through App.Go, with App.Busy and App.Notify for the status bar. Headless runs an application without a terminal, for tests. internal/ttyin holds the wakeable terminal read the app loop uses. The demo gains a tui command: a ticket tool on made-up tickets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
New package
tui: building blocks for full-screen terminal applications (the kind lazygit, k9s or htop are), with no new dependency.App.Go/Busy/Notifyfor blocking work.?/F1 help; decoder for modifiers, F-keys, CSI-u, SGR mouse, paste (fuzzed).VBox/HBox,Panel,Pages,Tabs,Pad,Keyed;Label,Viewport(scroll, search);List[T](list or table, filter, marks, paging);Input(readline keys, undo, suggestions, secret);TextArea;Toggle(checkbox/switch),RadioGroup,CheckList,Select,Button,Form;Dialog,Confirm,Prompt,Choose,Menu,EditText;Legend,StatusBar.term.Controls: a terminal acting on escape sequences regardless of color mode (refusesTERM=dumb, enables VT on Windows).internal/ttyin: wakeable terminal read (same approach as pick's).make demo ARGS=tui— a ticket tool on made-up tickets.Test plan
make check(vet, lint, race, locale, cross-compile, tidy)Headless,Exampletests,FuzzDecode🤖 Generated with Claude Code