This commit is contained in:
meganrogge 2025-07-31 13:36:42 -04:00
parent 937bb49161
commit 1d1e4d832f
No known key found for this signature in database
GPG Key ID: B8E497F5C2C8EDE8
1 changed files with 11 additions and 1 deletions

View File

@ -737,7 +737,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
class BackgroundTerminalExecution extends Disposable {
private _startMarker?: IXtermMarker;
private _isActive: boolean;
constructor(
readonly instance: ITerminalInstance,
private readonly _xterm: XtermTerminal,
@ -747,8 +747,18 @@ class BackgroundTerminalExecution extends Disposable {
this._startMarker = this._register(this._xterm.raw.registerMarker());
this.instance.runCommand(this._commandLine, true);
this._isActive = true;
const commandDetection = this.instance.capabilities.get(TerminalCapability.CommandDetection);
if (commandDetection) {
this._register(commandDetection.onCommandFinished(() => {
this._isActive = false;
}));
}
}
getOutput(): string {
return getOutput(this.instance, this._startMarker);
}
isActive(): Promise<boolean> {
return Promise.resolve(this._isActive);
}
}