diff --git a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts index 25ed46ed986..e50cb18d0ce 100644 --- a/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts +++ b/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts @@ -226,10 +226,11 @@ export class CommandDetectionCapability implements ICommandDetectionCapability { } serializeCommands(): ISerializedCommand[] { - const serialized = this.commands.map(e => { + const serialized: ISerializedCommand[] = this.commands.map(e => { return { startLine: e.marker?.line, endLine: e.endMarker?.line, + command: e.command, cwd: e.cwd, exitCode: e.exitCode, timestamp: e.timestamp @@ -239,6 +240,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability { serialized.push({ startLine: this._currentCommand.commandStartMarker.line, endLine: undefined, + command: '', cwd: undefined, exitCode: undefined, timestamp: 0, @@ -265,7 +267,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability { } // Full command const newCommand = { - command: '', + command: e.command, marker, endMarker: e.endLine !== undefined ? this._terminal.registerMarker(e.endLine - (buffer.baseY + buffer.cursorY)) : undefined, timestamp: e.timestamp, diff --git a/src/vs/platform/terminal/common/terminalProcess.ts b/src/vs/platform/terminal/common/terminalProcess.ts index 0bff257fd7a..9751078f1c7 100644 --- a/src/vs/platform/terminal/common/terminalProcess.ts +++ b/src/vs/platform/terminal/common/terminalProcess.ts @@ -69,6 +69,7 @@ export interface ReplayEntry { data: string; } export interface ISerializedCommand { + command: string; cwd: string | undefined; startLine: number | undefined; endLine: number | undefined;