Merged
Conversation
roblourens
reviewed
Jan 13, 2026
| */ | ||
| private _setupIdleInputListener(): void { | ||
| // Clean up any existing listener | ||
| this._userInputListener?.dispose(); |
Member
There was a problem hiding this comment.
MutableDisposable is the right pattern to avoid this duplication
roblourens
reviewed
Jan 13, 2026
| // Set up new listener | ||
| this._userInputListener = this._execution.instance.onDidInputData((data) => { | ||
| if (data === '\r' || data === '\n' || data === '\r\n') { | ||
| this._userInputtedSinceIdleDetected = true; |
Member
There was a problem hiding this comment.
The user could input without a newline, read doesn't need to read full lines
DonJayamanne
approved these changes
Jan 13, 2026
eli-w-king
pushed a commit
that referenced
this pull request
Jan 14, 2026
meganrogge
added a commit
that referenced
this pull request
Jan 14, 2026
meganrogge
added a commit
that referenced
this pull request
Jan 15, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
fixes #287642
When a user manually entered input into the terminal before the input prompt was created, the prompt would still appear and hang around even after the command finished.
This happened bc the input listener was being set up too late - only after the LLM finished analyzing the terminal output. Any user input that happened between idle detection and prompt creation was missed.
Fixes:
The input listener is now set up immediately when idle is detected inside waitForIdle, not after returning from it. This eliminates the race window between detecting idle and handling the idle state.
Added checks for
_userInputtedSinceIdleDetectedat multiple points:_selectAndHandleOption()(another LLM call)If the user has inputted at any of these checkpoints, we skip showing the prompt and continue polling instead.