Repository navigation
Keep the updater from freezing on its last line - #9
Merged
Merged
Conversation
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.
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.
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'stea.ExecProcesshands a foreground commandp.input, andos/execcan'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.Waitnever returns, so the finished message never arrives and the event loop never resumes. Claude Code'sauth loginfrom/loginfroze the same way.Fix:
execInTerminal(internal/ui/foreground.go) setscmd.Stdin = os.Stdinwhen stdin really is a terminal, then callstea.ExecProcess. A real file is inherited directly and needs no copy. When stdin is redirected it stays nil, so Bubble Tea's/dev/ttyhandling is unchanged. Both call sites now use it.Reproduced standalone before the change (installer output printed, then
Waitblocked indefinitely versus returning immediately with a real*os.File).go vet ./...andgo test ./...pass.