From fd7866ecdedc91b7baae9bfe2fec4e7a513b0e4e Mon Sep 17 00:00:00 2001 From: Chapman Pendery <35637443+cpendery@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:53:58 -0800 Subject: [PATCH] fix: completion fails to detect space when represented with cursor movement (#116) Signed-off-by: Chapman Pendery --- src/isterm/commandManager.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/isterm/commandManager.ts b/src/isterm/commandManager.ts index b8d6171..3503c85 100644 --- a/src/isterm/commandManager.ts +++ b/src/isterm/commandManager.ts @@ -205,10 +205,12 @@ export class CommandManager { for (let i = lineY == promptEndMarker.line ? this.#activeCommand.promptText.length : 0; i < this.#terminal.cols; i++) { const cell = line?.getCell(i); if (cell == null) continue; + const chars = cell.getChars(); + const cleanedChars = chars == "" ? " " : chars; if (!this._isSuggestion(cell) && suggestions.length == 0) { - command += cell.getChars(); + command += cleanedChars; } else { - suggestions += cell.getChars(); + suggestions += cleanedChars; } } lineY += 1;