Merge pull request #210782 from microsoft/tyriar/more_input_model

Enforce maximum adjust marker poll count
This commit is contained in:
Daniel Imms
2024-04-19 12:19:34 -07:00
committed by GitHub
2 changed files with 4 additions and 3 deletions
@@ -114,6 +114,8 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
setConfidentCommandLine(value: string): void {
if (this._value !== value) {
this._value = value;
this._cursorIndex = -1;
this._ghostTextIndex = -1;
this._onDidChangeInput.fire(this._createStateObject());
}
}
@@ -165,7 +167,6 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
this._onDidInterrupt.fire(event);
}
this._state = PromptInputState.Execute;
this._onDidFinishInput.fire(event);
this._onDidChangeInput.fire(event);
@@ -555,7 +555,7 @@ class UnixPtyHeuristics extends Disposable {
const enum AdjustCommandStartMarkerConstants {
MaxCheckLineCount = 10,
Interval = 20,
MaximumPollCount = 50,
MaximumPollCount = 10,
}
/**
@@ -736,7 +736,7 @@ class WindowsPtyHeuristics extends Disposable {
}
if (scannedLineCount < AdjustCommandStartMarkerConstants.MaxCheckLineCount) {
this._tryAdjustCommandStartMarkerScannedLineCount = scannedLineCount;
if (this._tryAdjustCommandStartMarkerPollCount < AdjustCommandStartMarkerConstants.MaximumPollCount) {
if (++this._tryAdjustCommandStartMarkerPollCount < AdjustCommandStartMarkerConstants.MaximumPollCount) {
this._tryAdjustCommandStartMarkerScheduler?.schedule();
} else {
this._flushPendingHandleCommandStartTask();