From 5f2f7d06793738605681dc69e17feea120cba3f9 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 20 Jul 2026 09:09:56 +0200 Subject: [PATCH] fix(tui): clear inverted cursor on exit to avoid dual cursor appearance (#6790) When pi exits, the reverse-video cursor character remains visible on the editor prompt line. Combined with the terminal's own cursor below, this creates the appearance of two cursors, which is confusing. Overwrite the inverted cursor with a normal space before exiting. --- packages/tui/src/tui.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/tui/src/tui.ts b/packages/tui/src/tui.ts index a7054888..b7ebaea9 100644 --- a/packages/tui/src/tui.ts +++ b/packages/tui/src/tui.ts @@ -695,6 +695,8 @@ export class TUI extends Container { } // Move cursor to the end of the content to prevent overwriting/artifacts on exit if (this.previousLines.length > 0) { + // Overwrite the inverted cursor with a normal space to clear the artifact + this.terminal.write(" "); const targetRow = this.previousLines.length; // Line after the last content const lineDiff = targetRow - this.hardwareCursorRow; if (lineDiff > 0) {