diff --git a/src/benchmark/cli.zig b/src/benchmark/cli.zig index 6cab79025..19db37a3d 100644 --- a/src/benchmark/cli.zig +++ b/src/benchmark/cli.zig @@ -45,12 +45,12 @@ pub const Action = enum { }; /// An entrypoint for the benchmark CLI. -pub fn main(init: std.process.Init) !void { - try global.init(.{ .tool = init }); +pub fn main(minimal: std.process.Init.Minimal) !void { + try global.init(.{ .tool = minimal }); const alloc = std.heap.c_allocator; - const action_ = try cli.action.detectArgs(Action, alloc, init.minimal.args); + const action_ = try cli.action.detectArgs(Action, alloc, minimal.args); const action = action_ orelse return error.NoAction; - try mainAction(alloc, action, .{ .cli = init.minimal.args }); + try mainAction(alloc, action, .{ .cli = minimal.args }); } /// Arguments that can be passed to the benchmark. diff --git a/src/global.zig b/src/global.zig index dd9264f3a..f43845078 100644 --- a/src/global.zig +++ b/src/global.zig @@ -34,14 +34,14 @@ pub const xev = @import("xev").Dynamic; var state: ?GlobalState = undefined; pub const InitOpts = union(enum) { - main: std.process.Init, + main: std.process.Init.Minimal, /// Same as `main` but for auxiliary tool binaries (e.g. ghostty-bench /// and ghostty-gen) that have their own CLI action namespace. This /// skips detection of ghostty app CLI actions, since tool actions /// (e.g. `+terminal-stream`) are not valid app actions and would /// otherwise cause init to fail with InvalidAction. - tool: std.process.Init, + tool: std.process.Init.Minimal, c: struct { argc: usize, @@ -60,11 +60,11 @@ pub fn init(opts: InitOpts) !void { .gpa = null, .alloc = undefined, .environ = switch (opts) { - .main, .tool => |m| m.minimal.environ, + .main, .tool => |m| m.environ, .c => |c| c.environ, }, .args = switch (opts) { - .main, .tool => |m| m.minimal.args, + .main, .tool => |m| m.args, // TODO: Using the C API from Windows is unsupported at this time. // // When do we plan on supporting Windows, it's recommended to diff --git a/src/main_ghostty.zig b/src/main_ghostty.zig index 2ed0606f8..b83505f47 100644 --- a/src/main_ghostty.zig +++ b/src/main_ghostty.zig @@ -23,12 +23,12 @@ const MainReturn = switch (build_config.artifact) { else => void, }; -pub fn main(init: std.process.Init) !MainReturn { +pub fn main(minimal: std.process.Init.Minimal) !MainReturn { // We first start by initializing our global state. This will setup // process-level state we need to run the terminal. The reason we use // a global is because the C API needs to be able to access this state; // no other Zig code should EVER access the global state. - global.init(.{ .main = init }) catch |err| { + global.init(.{ .main = minimal }) catch |err| { var buffer: [1024]u8 = undefined; var stderr_writer = std.Io.File.stderr().writer(global.io(), &buffer); const stderr = &stderr_writer.interface;