Fix hooks.

This commit is contained in:
Greyson Parrelli
2026-08-12 18:50:16 -04:00
parent dca5ec0b7d
commit 4e0e400372
7 changed files with 471 additions and 126 deletions
+7
View File
@@ -56,6 +56,11 @@ on_focus: *const fn (ctx: ?*anyopaque) void,
/// it in the tab strip.
on_status: *const fn (ctx: ?*anyopaque, status: Status) void,
/// Called when the user types into this terminal. Focus isn't enough for
/// this: the owner uses it as the sign that whatever the session had to say
/// has been dealt with, and that is answering, not looking.
on_input: *const fn (ctx: ?*anyopaque) void,
ctx: ?*anyopaque = null,
/// What a layout can specify for a terminal pane.
@@ -84,6 +89,7 @@ pub fn create(
.on_exit = cbs.on_exit,
.on_focus = cbs.on_focus,
.on_status = cbs.on_status,
.on_input = cbs.on_input,
.ctx = cbs.ctx,
};
@@ -311,6 +317,7 @@ fn onKeyPressed(
// Typing should always snap the view back to the prompt.
self.session.term.screens.active.pages.scroll(.active);
self.session.write(encoded);
self.on_input(self.ctx);
self.area.as(gtk.Widget).queueDraw();
return 1;
}