input: add crash binding action, remove key input crash

This commit is contained in:
Mitchell Hashimoto
2024-08-31 20:18:58 -07:00
parent e7cbeba140
commit 49e56a9057
2 changed files with 9 additions and 2 deletions

View File

@ -1333,8 +1333,6 @@ pub fn keyCallback(
self: *Surface,
event: input.KeyEvent,
) !InputEffect {
// To test crash reporting
if (true) @panic("OH NO");
// log.debug("text keyCallback event={}", .{event});
// Setup our inspector event if we have an inspector.
@ -3675,6 +3673,8 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
.quit => try self.app.setQuit(),
.crash => @panic("crash binding action, crashing intentionally"),
.adjust_selection => |direction| {
self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock();

View File

@ -300,6 +300,13 @@ pub const Action = union(enum) {
/// Quit ghostty.
quit: void,
/// Crash ghostty. This is funny, but is used for testing crash handling.
/// It is shipped in production builds because sometimes we need to
/// test crash handling works for a user who may have some specific
/// configuration. This is not bound by default and I recommend not
/// binding it.
crash: void,
pub const CursorKey = struct {
normal: []const u8,
application: []const u8,