Repository navigation
Terminal progress/cursor state not restored when aube exits on error #1558
|
When I noticed this with: aubx @slkiser/opencode-quota showwhich currently fails with After the command exits iTerm2 still shows an active progress indicator on the tab. ReproductionRun: aubx @slkiser/opencode-quota showand have it terminate with an error while the progress UI is active. Observed with: In my case the error is: Observed behaviorAfter returning to the shell, iTerm2 still considers terminal progress active. The progress state can be reset with: printf '\e]9;4;0\a'Expected behaviorTerminal state used by the progress renderer should always be restored when This presumably needs cleanup in a |
Replies: 1 comment
|
Confirmed, and this has the same root cause as your cursor report in #1557 — one fix covers both. The progress renderer drives the OSC 9;4 taskbar indicator as it paints and clears it during teardown, alongside restoring the cursor. That teardown was gated on a reference count that can never reach its trigger value (clx keeps a strong reference to the progress job in a process-global registry for the life of the process), so on an error path it simply never ran: no cursor restore, no indicator clear. Reproduced here through a PTY with
Fix is up in #1559, with a PTY-driven regression test asserting both the cursor restore and the indicator clear on a failing install. Your One gap that fix does not close: Ctrl-C during an install still leaves both behind, since nothing restores the terminal from a signal handler. Tracking that separately. AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: 2.1.270. |
Confirmed, and this has the same root cause as your cursor report in #1557 — one fix covers both.
The progress renderer drives the OSC 9;4 taskbar indicator as it paints and clears it during teardown, alongside restoring the cursor. That teardown was gated on a reference count that can never reach its trigger value (clx keeps a strong reference to the progress job in a process-global registry for the life of the process), so on an error path it simply never ran: no cursor restore, no indicator clear.
Reproduced here through a PTY with
TERM_PROGRAM=iTerm.app, running the sameaubx @slkiser/opencode-quota show. The last OSC sequence aube emits before exiting:ESC ] 9 ; 4 ; …sequence