Add custom layout creation.

This commit is contained in:
Greyson Parrelli
2026-08-11 13:57:54 -04:00
parent a7a9429d09
commit 3026bdcd4c
14 changed files with 1964 additions and 20 deletions
+9 -2
View File
@@ -54,7 +54,14 @@ on_focus: *const fn (ctx: ?*anyopaque) void,
ctx: ?*anyopaque = null,
pub fn create(alloc: std.mem.Allocator, cbs: Pane.Callbacks) !*Terminal {
/// What a layout can specify for a terminal pane.
pub const Options = Session.Options;
pub fn create(
alloc: std.mem.Allocator,
opts: Options,
cbs: Pane.Callbacks,
) !*Terminal {
const self = try alloc.create(Terminal);
errdefer alloc.destroy(self);
@@ -76,7 +83,7 @@ pub fn create(alloc: std.mem.Allocator, cbs: Pane.Callbacks) !*Terminal {
// The grid size follows the widget size, but we need a starting point
// for the session before the widget has ever been allocated.
self.session = try .create(alloc, 80, 24, .{
self.session = try .create(alloc, 80, 24, opts, .{
.on_damage = &onDamage,
.on_title = &onSessionTitle,
.on_exit = &onSessionExit,