Fire onCommandFinished even when the command is invalid

Fixes #252489
This commit is contained in:
Daniel Imms 2025-06-26 12:04:57 -07:00
parent 102ea798ba
commit cddd795497
No known key found for this signature in database
GPG Key ID: E5CF412B63651C69
1 changed files with 5 additions and 4 deletions

View File

@ -391,10 +391,11 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe
if (newCommand) {
this._commands.push(newCommand);
this._onBeforeCommandFinished.fire(newCommand);
if (!this._currentCommand.isInvalid) {
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
this._onCommandFinished.fire(newCommand);
}
// NOTE: onCommandFinished used to not fire if the command was invalid, but this causes
// problems especially with the associated execution event never firing in the extension
// API. See https://github.com/microsoft/vscode/issues/252489
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
this._onCommandFinished.fire(newCommand);
}
this._currentCommand = new PartialTerminalCommand(this._terminal);
this._handleCommandStartOptions = undefined;