mirror of
https://github.com/wavetermdev/inshellisense.git
synced 2026-08-05 13:43:30 -07:00
fix: prompt detection on clears (#132)
Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
@@ -46,6 +46,9 @@ export class CommandManager {
|
||||
}
|
||||
}
|
||||
handlePromptStart() {
|
||||
if (this.#activeCommand.promptStartMarker?.line == -1) {
|
||||
this.#previousCommandLines = new Set();
|
||||
}
|
||||
this.#activeCommand = { promptStartMarker: this.#terminal.registerMarker(0), hasOutput: false, cursorTerminated: false };
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ export const render = async (shell: Shell) => {
|
||||
const newlines = Math.max((data.match(/\r/g) || []).length, (data.match(/\n/g) || []).length);
|
||||
const linesOfInterest = MAX_LINES + newlines;
|
||||
if (term.getCursorState().remainingLines <= previousSuggestionsRows) {
|
||||
// handles when suggestions get loaded before shell output so you need to always clear below output as a precaution
|
||||
if (term.getCursorState().remainingLines != 0) {
|
||||
writeOutput(ansi.cursorHide + ansi.cursorSavePosition + eraseLinesBelow(linesOfInterest + 1) + ansi.cursorRestorePosition);
|
||||
}
|
||||
writeOutput(
|
||||
data +
|
||||
ansi.cursorHide +
|
||||
|
||||
Reference in New Issue
Block a user