mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
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.
This commit is contained in:
parent
94373d815d
commit
5f2f7d0679
1 changed files with 2 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue