fix(terminal): suppress false busy state after terminal resize#2365
Merged
gregpriday merged 2 commits intomainfrom Feb 26, 2026
Merged
fix(terminal): suppress false busy state after terminal resize#2365gregpriday merged 2 commits intomainfrom
gregpriday merged 2 commits intomainfrom
Conversation
- Derive project name from worktree directory basename (kebab-cased, lowercase)
- Replace fixed 'context-' prefix with the project name for easier identification
- Cap project name at 50 chars; filename pattern is now {project}-{branch}-{timestamp}.{ext}
Adds a resize suppression window to ActivityMonitor that prevents reflow bytes emitted by SIGWINCH from triggering false idle→busy transitions. - Add `notifyResize(suppressionMs=1000)` to ActivityMonitor that sets a `resizeSuppressUntil` timestamp and resets the high-output window - Guard all idle→busy transitions during suppression: high-output recovery, non-polling pattern detection, line-rewrite detection, and the polling cycle working-signal branch - Call `activityMonitor.notifyResize()` from TerminalProcess.resize() after PTY and headless terminal are resized - Add 5 unit tests covering suppression window, expiry, polling cycle suppression, rapid successive resizes, and busy-terminal preservation
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
Prevents false idle→busy transitions when terminal resize sends
SIGWINCHto the PTY, causing xterm to reflow its content and emit ANSI escape sequences that theActivityMonitormisinterprets as real agent activity.Closes #2364
Changes Made
ActivityMonitor.ts— AddednotifyResize(suppressionMs = 1000)public method that sets aresizeSuppressUntiltimestamp and resets the high-output tracking window. Guards inonData()andrunPollingCycle()skip all idle→busy transitions during the suppression window:becomeBusyFromPattern)becomeBusyviaupdateLineRewriteDetection)TerminalProcess.ts— Callsthis.activityMonitor.notifyResize()insideresize()after both the PTY process and headless terminal have been resized. Guarded bythis.activityMonitornull check; exited terminals are unaffected by the existing early return.ActivityMonitor.test.ts— 5 new unit tests in"Resize suppression (Issue #2364)"describe block: