mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Set busy flag on ExecaTerminal so it reports in env details when backgrounded (#3031)
* Set busy flag on ExecaTerminal so it reports in env details when backgrounded * Revert this
This commit is contained in:
parent
d07e60575b
commit
8df1ee0252
4 changed files with 14 additions and 8 deletions
|
|
@ -2053,15 +2053,15 @@ export class Cline extends EventEmitter<ClineEvents> {
|
|||
...TerminalRegistry.getBackgroundTerminals(false),
|
||||
]
|
||||
|
||||
if (busyTerminals.length > 0 && this.didEditFile) {
|
||||
await delay(300) // delay after saving file to let terminals catch up
|
||||
}
|
||||
|
||||
if (busyTerminals.length > 0) {
|
||||
if (this.didEditFile) {
|
||||
await delay(300) // Delay after saving file to let terminals catch up.
|
||||
}
|
||||
|
||||
// Wait for terminals to cool down.
|
||||
await pWaitFor(() => busyTerminals.every((t) => !TerminalRegistry.isProcessHot(t.id)), {
|
||||
interval: 100,
|
||||
timeout: 15_000,
|
||||
timeout: 5_000,
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ export class ExecaTerminal extends BaseTerminal {
|
|||
}
|
||||
|
||||
public override runCommand(command: string, callbacks: RooTerminalCallbacks): RooTerminalProcessResultPromise {
|
||||
this.busy = true
|
||||
|
||||
const process = new ExecaTerminalProcess(this)
|
||||
process.command = command
|
||||
this.process = process
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ export class ExecaTerminalProcess extends BaseTerminalProcess {
|
|||
super()
|
||||
|
||||
this.terminalRef = new WeakRef(terminal)
|
||||
|
||||
this.once("completed", () => {
|
||||
this.terminal.busy = false
|
||||
})
|
||||
}
|
||||
|
||||
public get terminal(): RooTerminal {
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ export class Terminal extends BaseTerminal {
|
|||
}
|
||||
|
||||
public override runCommand(command: string, callbacks: RooTerminalCallbacks): RooTerminalProcessResultPromise {
|
||||
// We set busy before the command is running because the terminal may be waiting
|
||||
// on terminal integration, and we must prevent another instance from selecting
|
||||
// the terminal for use during that time.
|
||||
// We set busy before the command is running because the terminal may be
|
||||
// waiting on terminal integration, and we must prevent another instance
|
||||
// from selecting the terminal for use during that time.
|
||||
this.busy = true
|
||||
|
||||
const process = new TerminalProcess(this)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue