add: .line core event for line contents in non *raw mode* instead of .key core events

The end of the `.line` event received contents is highlighted by a trailing newline
(which cannot occur before, as that triggers the line event itself).

Add signal handler for SIGCONT which forces a `.resize` event that should re-draw the
contents after continuing a suspended application (i.e. ctrl+z followed by `fg`).
This commit is contained in:
2026-01-20 15:11:19 +01:00
parent 97a240c54d
commit a71d808250
3 changed files with 30 additions and 12 deletions

View File

@@ -46,6 +46,7 @@ const Prompt = struct {
};
}
// NOTE size hint is not required as the `.size = .{ .dim = .{..} }` property is set accordingly which denotes the minimal size
// fn minSize(ctx: *anyopaque, _: *const App.Model, _: zterm.Point) zterm.Point {
// const this: *@This() = @ptrCast(@alignCast(ctx));
// return .{ .x = this.len, .y = 1 };
@@ -140,9 +141,8 @@ pub fn main() !void {
switch (event) {
// NOTE maybe I want to decouple the `key`s from the user input too? i.e. this only makes sense if the output is not echoed!
// otherwise just use gnu's `readline`?
.key => |key| {
// if (key.eql(.{ .cp = 'q' })) app.quit();
_ = key;
.line => |line| {
log.debug("{s}", .{line});
},
// NOTE errors could be displayed in another container in case one was received, etc. to provide the user with feedback
.err => |err| log.err("Received {s} with message: {s}", .{ @errorName(err.err), err.msg }),