Repository navigation
fix(ui): force terminal restore if spinner cleanup times out - #1086
Merged
Merged
Conversation
Stop() waited up to 500ms for bubbletea's async goroutine to restore the pty (echo, raw mode) before returning. Command error paths call s.Stop() immediately followed by log.Fatalln(err), which os.Exit()s directly and skips all defers β if bubbletea hadn't finished restoring within that window, the process died with the pty stuck in raw mode for the rest of the shell session (no echo, and later output missing line-feed post-processing). Capture the terminal's pristine cooked-mode state once before any spinner engages raw mode, and force-restore it if Stop()'s wait times out, so an os.Exit() right after can no longer strand the terminal. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TRdmSy4Vdaua7eKpZCe33Z
2 of 3 tasks
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
Spinner.Stop()waited up to 500ms for bubbletea's async goroutine to restore the pty (echo, raw mode) before returning.s.Stop()immediately followed bylog.Fatalln(err), which callsos.Exit()directly and skips all defers β if bubbletea hadn't finished its restore within that window, the process died with the pty stuck in raw mode for the rest of the shell session (no echo, and later output missing line-feed post-processing, e.g. staircasedhcloudhelp text).Stop()'s wait times out, so anos.Exit()right after can no longer strand the terminal.Test plan
go build ./...go vet ./internal/ui/...π€ Generated with Claude Code
https://claude.ai/code/session_01TRdmSy4Vdaua7eKpZCe33Z