mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-06 21:37:49 +00:00
remove stage1 workarounds
This commit is contained in:
@@ -431,10 +431,7 @@ pub fn threadEnter(self: *const OpenGL, window: glfw.Window) !void {
|
||||
|
||||
// Load OpenGL bindings. This API is context-aware so this sets
|
||||
// a threadlocal context for these pointers.
|
||||
const version = try gl.glad.load(switch (builtin.zig_backend) {
|
||||
.stage1 => glfw.getProcAddress,
|
||||
else => &glfw.getProcAddress,
|
||||
});
|
||||
const version = try gl.glad.load(&glfw.getProcAddress);
|
||||
errdefer gl.glad.unload();
|
||||
log.info("loaded OpenGL {}.{}", .{
|
||||
gl.glad.versionMajor(@intCast(c_uint, version)),
|
||||
|
||||
@@ -91,6 +91,9 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec {
|
||||
.args = &[_][]const u8{path},
|
||||
.env = &env,
|
||||
.cwd = opts.config.@"working-directory",
|
||||
.stdin = .{ .handle = pty.slave },
|
||||
.stdout = .{ .handle = pty.slave },
|
||||
.stderr = .{ .handle = pty.slave },
|
||||
.pre_exec = (struct {
|
||||
fn callback(cmd: *Command) void {
|
||||
const p = cmd.getData(Pty) orelse unreachable;
|
||||
@@ -100,11 +103,6 @@ pub fn init(alloc: Allocator, opts: termio.Options) !Exec {
|
||||
}).callback,
|
||||
.data = &pty,
|
||||
};
|
||||
// note: can't set these in the struct initializer because it
|
||||
// sets the handle to "0". Probably a stage1 zig bug.
|
||||
cmd.stdin = std.fs.File{ .handle = pty.slave };
|
||||
cmd.stdout = cmd.stdin;
|
||||
cmd.stderr = cmd.stdin;
|
||||
try cmd.start(alloc);
|
||||
log.info("started subcommand path={s} pid={?}", .{ path, cmd.pid });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user