fix: emit line event when command output starts

This fixes an issue where commands that wait for input (like 'cat'
without arguments) would hang indefinitely because no 'line' event was
emitted. The terminal would receive the VSCode shell integration marker
indicating command output has started, but since there was no actual
output yet, the UI would not proceed.

By emitting an empty line event when command output starts, we ensure
the UI can proceed even when a command is waiting for input, preventing
the task from hanging.

Thank you @cte for pointing this out in the PR development process.

Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
This commit is contained in:
Eric Wheeler 2025-03-07 09:41:51 -08:00
parent d25bcb1913
commit 24d8ef91ce

View file

@ -206,6 +206,7 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
commandOutputStarted = true
data = match
this.fullOutput = "" // Reset fullOutput when command actually starts
this.emit("line", "") // Trigger UI to proceed
} else {
continue
}