Skip to content

Commit 2f81f8b

Browse files
committed
Remove ghost text from command line on execute
Fixes microsoft#210777
1 parent de1b891 commit 2f81f8b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,13 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
153153
}
154154

155155
this._cursorIndex = -1;
156-
this._ghostTextIndex = -1;
156+
157+
// Remove any ghost text from the input if it exists on execute
158+
if (this._ghostTextIndex !== -1) {
159+
this._value = this._value.substring(0, this._ghostTextIndex);
160+
this._ghostTextIndex = -1;
161+
}
162+
157163
const event = this._createStateObject();
158164
if (this._lastUserInput === '\u0003') {
159165
this._onDidInterrupt.fire(event);

0 commit comments

Comments
 (0)