This commit is contained in:
Megan Rogge
2023-10-10 11:45:59 -07:00
parent c34767cea6
commit 173c8faf3b
@@ -103,7 +103,9 @@ export class TextAreaSyncAddon extends Disposable implements ITerminalAddon {
}
if (currentCommand.commandStartX !== undefined) {
this._currentCommand = commandLine.substring(currentCommand.commandStartX);
this._cursorX = buffer.cursorX - currentCommand.commandStartX;
const cursorPosition = buffer.cursorX - currentCommand.commandStartX;
this._cursorX = cursorPosition >= 0 ? cursorPosition : 0;
this._logService.debug('cursor', this._cursorX);
} else {
this._currentCommand = undefined;
this._cursorX = undefined;