Skip to content

Commit 4026f75

Browse files
committed
use backend isWindows and only use start marker if necessary
1 parent 34cba75 commit 4026f75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { timeout } from 'vs/base/common/async';
77
import { debounce } from 'vs/base/common/decorators';
88
import { Emitter } from 'vs/base/common/event';
9-
import { isWindows } from 'vs/base/common/platform';
109
import { ILogService } from 'vs/platform/log/common/log';
1110
import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand, IHandleCommandOptions, ICommandInvalidationRequest, CommandInvalidationReason, ISerializedCommand, ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
1211
import { ITerminalOutputMatch, ITerminalOutputMatcher } from 'vs/platform/terminal/common/terminal';
@@ -492,7 +491,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
492491
commandStartLineContent: this._currentCommand.commandStartLineContent,
493492
hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker?.line < endMarker!.line),
494493
getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer),
495-
getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(isWindows ? this._currentCommand.commandStartMarker : executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher),
494+
getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(this._isWindowsPty && (executedMarker?.line === endMarker?.line) ? this._currentCommand.commandStartMarker : executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher),
496495
markProperties: options?.markProperties
497496
};
498497
this._commands.push(newCommand);
@@ -618,7 +617,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
618617
exitCode: e.exitCode,
619618
hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker.line < endMarker.line),
620619
getOutput: () => getOutputForCommand(executedMarker, endMarker, buffer),
621-
getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(isWindows ? marker : executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher),
620+
getOutputMatch: (outputMatcher: ITerminalOutputMatcher) => getOutputMatchForCommand(this._isWindowsPty && (executedMarker?.line === endMarker?.line) ? marker : executedMarker, endMarker, buffer, this._terminal.cols, outputMatcher),
622621
markProperties: e.markProperties,
623622
wasReplayed: true
624623
};

0 commit comments

Comments
 (0)