mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
Merge pull request #1245 from mitchellh/clear-screen-consume
core: clear_screen binding doesn't consume on alt screen
This commit is contained in:
@ -2788,6 +2788,17 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
},
|
||||
|
||||
.clear_screen => {
|
||||
// This is a duplicate of some of the logic in termio.clearScreen
|
||||
// but we need to do this here so we can know the answer before
|
||||
// we send the message. If the currently active screen is on the
|
||||
// alternate screen then clear screen does nothing so we want to
|
||||
// return false so the keybind can be unconsumed.
|
||||
{
|
||||
self.renderer_state.mutex.lock();
|
||||
defer self.renderer_state.mutex.unlock();
|
||||
if (self.io.terminal.active_screen == .alternate) return false;
|
||||
}
|
||||
|
||||
_ = self.io_thread.mailbox.push(.{
|
||||
.clear_screen = .{ .history = true },
|
||||
}, .{ .forever = {} });
|
||||
|
Reference in New Issue
Block a user