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) {