mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 05:11:06 -05:00
Show loading spinner as soon as command starts and has output
This commit is contained in:
@@ -276,6 +276,7 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
|
||||
// todo: need to handle errors
|
||||
let isFirstChunk = true
|
||||
let didOutputNonCommand = false
|
||||
let didEmitEmptyLine = false
|
||||
for await (let data of stream) {
|
||||
console.log("original chunk:", data)
|
||||
if (isFirstChunk) {
|
||||
@@ -326,6 +327,12 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
|
||||
data = lines.join("\n")
|
||||
}
|
||||
|
||||
// For non-immediately returning commands we want to show loading spinner right away but this wouldnt happen until it emits a line break, so as soon as we get any output we emit "" to let webview know to show spinner
|
||||
if (!didEmitEmptyLine && !this.fullOutput && data) {
|
||||
this.emit("line", "") // empty line to indicate start of command output stream
|
||||
didEmitEmptyLine = true
|
||||
}
|
||||
|
||||
console.log(`parsed chunk:`, data)
|
||||
this.fullOutput += data
|
||||
if (this.isListening) {
|
||||
|
||||
Reference in New Issue
Block a user