From 2c0d4df2e19c052250a7665457c3e63d9dec53f6 Mon Sep 17 00:00:00 2001 From: Chapman Pendery <35637443+cpendery@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:13:07 -0700 Subject: [PATCH] fix: alt buffer issue when entering vi (#210) Signed-off-by: Chapman Pendery --- src/isterm/commandManager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/isterm/commandManager.ts b/src/isterm/commandManager.ts index ba7e71d..708550a 100644 --- a/src/isterm/commandManager.ts +++ b/src/isterm/commandManager.ts @@ -227,9 +227,11 @@ export class CommandManager { this.#activeCommand.promptEndMarker = this.#terminal.registerMarker(0); } + if (this.#activeCommand.promptEndMarker == null) return; + // if we haven't fond the prompt yet, poll over the next 5 lines searching for it if (this.#activeCommand.promptText == null && withinPollDistance) { - for (let i = globalCursorPosition; i < this.#activeCommand.promptEndMarker!.line + maxPromptPollDistance; i++) { + for (let i = globalCursorPosition; i < this.#activeCommand.promptEndMarker.line + maxPromptPollDistance; i++) { if (this.#previousCommandLines.has(i)) continue; const promptResult = this._getWindowsPrompt(i); if (promptResult != null) {