Don't add empty commands to command history

This commit is contained in:
Daniel Imms 2022-02-16 07:32:26 -08:00
parent 4733f74a95
commit 57d5e79b88

View file

@ -418,7 +418,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
});
} else if (e === TerminalCapability.CommandDetection) {
this.capabilities.get(TerminalCapability.CommandDetection)?.onCommandFinished(e => {
this._instantiationService.invokeFunction(getCommandHistory, this.shellType)?.add(e.command);
if (e.command.trim().length > 0) {
this._instantiationService.invokeFunction(getCommandHistory, this.shellType)?.add(e.command);
}
});
}
}));