Fix next command after restore

This commit is contained in:
Daniel Imms 2022-03-14 14:27:23 -07:00
parent 950205cdd1
commit 512145b4b9
2 changed files with 6 additions and 3 deletions

View file

@ -231,6 +231,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
const serialized: ISerializedCommand[] = this.commands.map(e => {
return {
startLine: e.marker?.line,
startX: undefined,
endLine: e.endMarker?.line,
executedLine: e.executedMarker?.line,
command: e.command,
@ -242,10 +243,11 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
if (this._currentCommand.commandStartMarker) {
serialized.push({
startLine: this._currentCommand.commandStartMarker.line,
startX: this._currentCommand.commandStartX,
endLine: undefined,
executedLine: undefined,
command: '',
cwd: undefined,
cwd: this._cwd,
exitCode: undefined,
timestamp: 0,
});
@ -264,8 +266,8 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
// Partial command
if (!e.endLine) {
this._currentCommand.commandStartMarker = marker;
// TODO: Get real value if needed
this._currentCommand.commandStartX = 0;
this._currentCommand.commandStartX = e.startX;
this._cwd = e.cwd;
this._onCommandStarted.fire({ marker } as ITerminalCommand);
continue;
}

View file

@ -72,6 +72,7 @@ export interface ISerializedCommand {
command: string;
cwd: string | undefined;
startLine: number | undefined;
startX: number | undefined;
endLine: number | undefined;
executedLine: number | undefined;
exitCode: number | undefined;