Skip to content

Commit da02a86

Browse files
authored
Merge pull request microsoft#210779 from microsoft/tyriar/210777
Remove ghost text from command line on execute
2 parents a21b3e7 + 2f81f8b commit da02a86

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)