Skip to content

Commit 0e28a10

Browse files
authored
Merge pull request microsoft#210782 from microsoft/tyriar/more_input_model
Enforce maximum adjust marker poll count
2 parents da02a86 + 7088965 commit 0e28a10

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
114114
setConfidentCommandLine(value: string): void {
115115
if (this._value !== value) {
116116
this._value = value;
117+
this._cursorIndex = -1;
118+
this._ghostTextIndex = -1;
117119
this._onDidChangeInput.fire(this._createStateObject());
118120
}
119121
}
@@ -165,7 +167,6 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
165167
this._onDidInterrupt.fire(event);
166168
}
167169

168-
169170
this._state = PromptInputState.Execute;
170171
this._onDidFinishInput.fire(event);
171172
this._onDidChangeInput.fire(event);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class UnixPtyHeuristics extends Disposable {
555555
const enum AdjustCommandStartMarkerConstants {
556556
MaxCheckLineCount = 10,
557557
Interval = 20,
558-
MaximumPollCount = 50,
558+
MaximumPollCount = 10,
559559
}
560560

561561
/**
@@ -736,7 +736,7 @@ class WindowsPtyHeuristics extends Disposable {
736736
}
737737
if (scannedLineCount < AdjustCommandStartMarkerConstants.MaxCheckLineCount) {
738738
this._tryAdjustCommandStartMarkerScannedLineCount = scannedLineCount;
739-
if (this._tryAdjustCommandStartMarkerPollCount < AdjustCommandStartMarkerConstants.MaximumPollCount) {
739+
if (++this._tryAdjustCommandStartMarkerPollCount < AdjustCommandStartMarkerConstants.MaximumPollCount) {
740740
this._tryAdjustCommandStartMarkerScheduler?.schedule();
741741
} else {
742742
this._flushPendingHandleCommandStartTask();

0 commit comments

Comments
 (0)