|
6 | 6 | import { timeout } from 'vs/base/common/async';
|
7 | 7 | import { debounce } from 'vs/base/common/decorators';
|
8 | 8 | import { Emitter } from 'vs/base/common/event';
|
9 |
| -import { isWindows } from 'vs/base/common/platform'; |
10 | 9 | import { ILogService } from 'vs/platform/log/common/log';
|
11 | 10 | import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand, IHandleCommandOptions, ICommandInvalidationRequest, CommandInvalidationReason, ISerializedCommand, ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/capabilities';
|
12 | 11 | import { ITerminalOutputMatch, ITerminalOutputMatcher } from 'vs/platform/terminal/common/terminal';
|
@@ -492,7 +491,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
|
492 | 491 | commandStartLineContent: this._currentCommand.commandStartLineContent,
|
493 | 492 | hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker?.line < endMarker!.line),
|
494 | 493 | 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), |
496 | 495 | markProperties: options?.markProperties
|
497 | 496 | };
|
498 | 497 | this._commands.push(newCommand);
|
@@ -618,7 +617,7 @@ export class CommandDetectionCapability implements ICommandDetectionCapability {
|
618 | 617 | exitCode: e.exitCode,
|
619 | 618 | hasOutput: () => !executedMarker?.isDisposed && !endMarker?.isDisposed && !!(executedMarker && endMarker && executedMarker.line < endMarker.line),
|
620 | 619 | 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), |
622 | 621 | markProperties: e.markProperties,
|
623 | 622 | wasReplayed: true
|
624 | 623 | };
|
|
0 commit comments