Fix: Reset terminal busy state after manual commands complete #4583
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.
Related GitHub Issue
Closes: #4319
Description
This PR addresses a bug where a Roo-managed terminal would get stuck in a "busy" state if a user-initiated (manual) command was run in it. The root cause was that the
onDidEndTerminalShellExecutionevent handler would return early for non-Roo-initiated processes without resetting thebusyflag.The fix is a one-line change in
src/integrations/terminal/TerminalRegistry.tsto setterminal.busy = falsebefore the early return, ensuring the terminal's state is accurately reset after any command finishes.Test Procedure
The fix was verified manually by following the reproduction steps outlined in the issue:
echo test).sleep 30).sleepcommand finishes, execute another command via Roo.busyflag was properly cleared.Automated tests were not added because the existing test file
src/integrations/terminal/__tests__/TerminalRegistry.test.tshas multiple pre-existing failures that are out of scope for this small bug fix.Type of Change
srcor test files.Honestly, having trouble recreating this issue but this is a one line change if anyone else could verify.
Co-authored-by: Mnehmos [email protected] via #4449
Important
Fixes bug where terminals remain 'busy' after manual commands by resetting the
busyflag inTerminalRegistry.TerminalRegistrywhere terminals remain 'busy' after manual commands by settingterminal.busy = falseinonDidEndTerminalShellExecution.TerminalRegistry.test.tsto verifybusyflag behavior for Roo and non-Roo terminals.This description was created by
for 91d4b56. You can customize this summary. It will automatically update as commits are pushed.