keyfork-prompt: clear terminal before leaving alt screen; fixes linux terminal

This commit is contained in:
Ryan Heywood 2025-02-19 16:31:06 -05:00
parent 083eb16b39
commit 0243212c80
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 7 additions and 0 deletions

View File

@ -131,6 +131,13 @@ where
self.write
.execute(DisableBracketedPaste)
.expect(bug!("can't restore bracketed paste"));
self.write
.queue(terminal::Clear(terminal::ClearType::All))
.expect(bug!("can't clear screen"))
.queue(cursor::MoveTo(0, 0))
.expect(bug!("can't move to origin"))
.flush()
.expect(bug!("can't execute clear+move"));
self.write
.execute(LeaveAlternateScreen)
.expect(bug!("can't leave alternate screen"));