Skip to content

Commit 69995fe

Browse files
committed
fix: only adjust input if prompt area is unwrapped
Signed-off-by: Chapman Pendery <[email protected]>
1 parent 2cd242c commit 69995fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,13 @@ class WindowsPtyHeuristics extends Disposable {
650650
}
651651

652652
handleInput() {
653+
const currentY = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY;
654+
655+
const hasWrappingInPrompt = Array.from({ length: (this._capability.currentCommand.promptHeight ?? 0) + 1 }, (_, i) => currentY - i).find(y => this._terminal.buffer.active.getLine(y)?.isWrapped) !== undefined;
653656
const hasActiveCommand = this._capability.currentCommand.commandStartX !== undefined && this._capability.currentCommand.commandExecutedX === undefined;
654657
const hasAdjusted = this._capability.currentCommand.isAdjusted === true || this._capability.currentCommand.isInputAdjusted === true;
655-
if (!hasActiveCommand || hasAdjusted) {
658+
659+
if (!hasActiveCommand || hasAdjusted || hasWrappingInPrompt) {
656660
return;
657661
}
658662
this._capability.currentCommand.isInputAdjusted = true;

0 commit comments

Comments
 (0)