mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Revert "termio: clear screen always sends form feed (0x0C)"
This reverts commit abc383854604189378bfe61239c14f263f7a14de. See #623
This commit is contained in:
@ -379,12 +379,20 @@ pub fn clearScreen(self: *Exec, history: bool) !void {
|
|||||||
// Clear our scrollback
|
// Clear our scrollback
|
||||||
if (history) try self.terminal.screen.clear(.history);
|
if (history) try self.terminal.screen.clear(.history);
|
||||||
|
|
||||||
// Clear our screen using terminal state.
|
// If we're not at a prompt, we clear the screen manually using
|
||||||
|
// the terminal screen state. If we are at a prompt, we send
|
||||||
|
// form-feed so that the shell can repaint the entire screen.
|
||||||
|
if (!self.terminal.cursorIsAtPrompt()) {
|
||||||
|
// Clear above the cursor
|
||||||
try self.terminal.screen.clear(.above_cursor);
|
try self.terminal.screen.clear(.above_cursor);
|
||||||
|
|
||||||
|
// Exit
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We also always send form feed so that the terminal can repaint
|
// If we reached here it means we're at a prompt, so we send a form-feed.
|
||||||
// our prompt.
|
assert(self.terminal.cursorIsAtPrompt());
|
||||||
try self.queueWrite(&[_]u8{0x0C});
|
try self.queueWrite(&[_]u8{0x0C});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user