Add VSCode workspace configuration mock to TerminalProcess.test.ts to handle PowerShell detection in terminal tests, matching the fix in TerminalProcessExec.test.ts
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
Mock VSCode workspace configuration to handle PowerShell detection in terminal tests. This prevents TypeError when accessing getConfiguration() in TerminalProcess.run()
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
PowerShell requires special handling for command output due to two issues:
- A sleep delay is required to prevent the ]633;D marker from losing the
original output
- A counter is needed to work around a bug where identical commands are not executed
Changes:
- Add cmdCounter to Terminal class for unique command tracking
- Add PowerShell detection via platform and default shell profile
- Add sleep delay to ensure output is captured before command completion
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit fixes an issue where subtasks weren't properly reporting back to parent tasks when cancelled and resumed. Previously, when a subtask was cancelled and a new task was started with the same message, the parent task would incorrectly resume, causing unexpected behavior.
The fix:
1. Stores parent-child relationship information before cancelling a task
2. Restores this relationship after task reinitialization
3. Ensures parent tasks only resume when explicitly instructed to do so
This approach maintains the correct task hierarchy throughout the cancellation and resumption process, preventing parent tasks from automatically resuming when unrelated tasks with similar messages are started.
Update TerminalProcessExec tests to properly handle shell integration
event sequences:
- Set terminal.running=true before command execution
- Remove duplicate command execution that could trigger extra events
- Replace arbitrary timeout with event-based waiting for output
- Ensure proper event sequence (run -> start -> output -> end)
This aligns the tests with the safeguards added in 62ffa797 that
prevent spurious shell integration events from corrupting terminal
state.
Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>