Skip to content

Keep the updater from freezing on its last line - #9

Merged
stawan15 merged 1 commit into
mainfrom
fix/update-freeze
Nov 1, 2026
Merged

stawan15 merged 1 commit into
mainfrom
fix/update-freeze

Conversation

@stawan15

@stawan15 stawan15 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Updating from inside teveus printed the installer's output and then stayed there forever — the window had to be killed.

Why: teveus wraps stdin in splitKeys (internal/ui/input.go:17) so a mouse report that arrives in pieces isn't typed as text. That wrapper isn't an *os.File. Bubble Tea's tea.ExecProcess hands a foreground command p.input, and os/exec can't let a child inherit a descriptor that isn't a file: it copies from the reader in a goroutine that waits for an EOF a terminal never sends. Wait never returns, so the finished message never arrives and the event loop never resumes. Claude Code's auth login from /login froze the same way.

Fix: execInTerminal (internal/ui/foreground.go) sets cmd.Stdin = os.Stdin when stdin really is a terminal, then calls tea.ExecProcess. A real file is inherited directly and needs no copy. When stdin is redirected it stays nil, so Bubble Tea's /dev/tty handling is unchanged. Both call sites now use it.

Reproduced standalone before the change (installer output printed, then Wait blocked indefinitely versus returning immediately with a real *os.File). go vet ./... and go test ./... pass.

teveus wraps the terminal's input in splitKeys, so a mouse report that
arrives in pieces isn't typed as text. Bubble Tea hands a foreground
command that same reader, and os/exec can't let a child inherit something
that isn't an *os.File: it copies from it in a goroutine that waits for an
EOF a terminal never sends. Wait then never returns, the finished message
never arrives, and the app sits on the installer's last line until it is
killed. Claude Code's sign-in from /login had the same freeze.

execInTerminal gives the command the terminal's own file when stdin really
is one, and leaves redirected stdin to Bubble Tea's /dev/tty as before.
@stawan15
stawan15 merged commit ea25b9a into main Nov 1, 2026
4 checks passed
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