Fix proceed button flickering

This commit is contained in:
Saoud Rizwan
2024-09-09 14:59:38 -04:00
parent 9be91e8543
commit ea65568876

View File

@@ -1346,6 +1346,7 @@ export class ClaudeDev {
const process = this.terminalManager.runCommand(terminalInfo, command) const process = this.terminalManager.runCommand(terminalInfo, command)
let userFeedback: { text?: string; images?: string[] } | undefined let userFeedback: { text?: string; images?: string[] } | undefined
let didContinue = false
const sendCommandOutput = async (line: string): Promise<void> => { const sendCommandOutput = async (line: string): Promise<void> => {
try { try {
const { response, text, images } = await this.ask("command_output", line) const { response, text, images } = await this.ask("command_output", line)
@@ -1354,6 +1355,7 @@ export class ClaudeDev {
} else { } else {
userFeedback = { text, images } userFeedback = { text, images }
} }
didContinue = true
process.continue() // continue past the await process.continue() // continue past the await
} catch { } catch {
// This can only happen if this ask promise was ignored, so ignore this error // This can only happen if this ask promise was ignored, so ignore this error
@@ -1363,7 +1365,11 @@ export class ClaudeDev {
let result = "" let result = ""
process.on("line", (line) => { process.on("line", (line) => {
result += line + "\n" result += line + "\n"
if (!didContinue) {
sendCommandOutput(line) sendCommandOutput(line)
} else {
this.say("command_output", line)
}
}) })
let completed = false let completed = false
@@ -1382,7 +1388,7 @@ export class ClaudeDev {
// for their associated messages to be sent to the webview, maintaining // for their associated messages to be sent to the webview, maintaining
// the correct order of messages (although the webview is smart about // the correct order of messages (although the webview is smart about
// grouping command_output messages despite any gaps anyways) // grouping command_output messages despite any gaps anyways)
await delay(50) await delay(100)
result = result.trim() result = result.trim()