Upgrade to BubbleTea v2 and standardize interactive terminal checks - #188
Open
nathanjcochran wants to merge 4 commits into
Open
Upgrade to BubbleTea v2 and standardize interactive terminal checks#188nathanjcochran wants to merge 4 commits into
nathanjcochran wants to merge 4 commits into
Conversation
nathanjcochran
force-pushed
the
nathan/bubbletea-v2
branch
from
August 12, 2026 20:07
78139db to
8961cee
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.
Upgrades BubbleTea from v1 to v2 (
charm.land/bubbletea/v2), following the patterns already established in ghost.This isn't just a version bump, because v2 asks the terminal for keyboard disambiguation (the Kitty keyboard protocol). With that enabled, Ctrl+C arrives as a key press on stdin rather than as a SIGINT. Our spinner previously ran with no stdin attached, on the grounds that it never reads keys — under v2 that would have meant Ctrl+C silently doing nothing while a wait was in progress. The spinner now takes stdin and translates the keypress into cancelling the wait, so the behavior is what it was before. The interactive menus opt out of BubbleTea's own signal handler, since Ctrl+C is already handled as a key press and everything else is caught by the handler in
main.go(which cancels the context and thereby shuts down the bubbletea program).This PR also standardizes the terminal checks guarding interactive UI. Prompts used to require only stdin to be a terminal, while BubbleTea programs required stdin and stderr. That inconsistency meant a prompt with stderr redirected was invisible: it read as a hang, and a stray keypress could answer it by accident (for example, a bare Enter at
service update-passwordwould rotate the password). Every prompt, menu, and confirmation now requires both streams and otherwise fails immediately.CLAUDE.md is updated to describe both patterns, with the gating rule now stated once and shared by prompts and BubbleTea programs.