Skip to content

Upgrade to BubbleTea v2 and standardize interactive terminal checks - #188

Open
nathanjcochran wants to merge 4 commits into
mainfrom
nathan/bubbletea-v2
Open

Upgrade to BubbleTea v2 and standardize interactive terminal checks#188
nathanjcochran wants to merge 4 commits into
mainfrom
nathan/bubbletea-v2

Conversation

@nathanjcochran

@nathanjcochran nathanjcochran commented Aug 12, 2026

Copy link
Copy Markdown
Member

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-password would 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.

@nathanjcochran nathanjcochran self-assigned this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant