Skip to content

Commit 565523e

Browse files
committed
Set 633 E command line in PromptInputModel
1 parent 2c9202a commit 565523e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
111111
this._continuationPrompt = value;
112112
}
113113

114+
setConfidentCommandLine(value: string): void {
115+
if (this._value !== value) {
116+
this._value = value;
117+
this._onDidChangeInput.fire(this._createStateObject());
118+
}
119+
}
120+
114121
getCombinedString(): string {
115122
const value = this._value.replaceAll('\n', '\u23CE');
116123
if (this._cursorIndex === -1) {
@@ -152,6 +159,7 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
152159
this._onDidInterrupt.fire(event);
153160
}
154161

162+
155163
this._state = PromptInputState.Execute;
156164
this._onDidFinishInput.fire(event);
157165
this._onDidChangeInput.fire(event);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe
402402
this._currentCommand.command = commandLine;
403403
this._currentCommand.commandLineConfidence = 'high';
404404
this._currentCommand.isTrusted = isTrusted;
405+
406+
if (isTrusted) {
407+
this._promptInputModel.setConfidentCommandLine(commandLine);
408+
}
405409
}
406410

407411
serialize(): ISerializedCommandDetectionCapability {

0 commit comments

Comments
 (0)