diff --git a/macos/Ghostty.entitlements b/macos/Ghostty.entitlements index f2ef3ae02..0c67376eb 100644 --- a/macos/Ghostty.entitlements +++ b/macos/Ghostty.entitlements @@ -1,10 +1,5 @@ - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-only - - + diff --git a/macos/Ghostty.xcodeproj/project.pbxproj b/macos/Ghostty.xcodeproj/project.pbxproj index 7eef0edd0..a0a9e76dd 100644 --- a/macos/Ghostty.xcodeproj/project.pbxproj +++ b/macos/Ghostty.xcodeproj/project.pbxproj @@ -301,7 +301,7 @@ ); MARKETING_VERSION = 0.1; "OTHER_LDFLAGS[arch=*]" = "-lstdc++"; - PRODUCT_BUNDLE_IDENTIFIER = com.mitchellh.Ghostty; + PRODUCT_BUNDLE_IDENTIFIER = com.mitchellh.ghostty; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -323,6 +323,7 @@ DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; + GCC_OPTIMIZATION_LEVEL = fast; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = Ghostty; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; @@ -333,7 +334,7 @@ ); MARKETING_VERSION = 0.1; "OTHER_LDFLAGS[arch=*]" = "-lstdc++"; - PRODUCT_BUNDLE_IDENTIFIER = com.mitchellh.Ghostty; + PRODUCT_BUNDLE_IDENTIFIER = com.mitchellh.ghostty; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; diff --git a/src/Pty.zig b/src/Pty.zig index a09b2519e..c61c9feb9 100644 --- a/src/Pty.zig +++ b/src/Pty.zig @@ -19,6 +19,8 @@ const c = switch (builtin.os.tag) { }), }; +const log = std.log.scoped(.pty); + // https://github.com/ziglang/zig/issues/13277 // Once above is fixed, use `c.TIOCSCTTY` const TIOCSCTTY = if (builtin.os.tag == .macos) 536900705 else c.TIOCSCTTY; @@ -102,8 +104,13 @@ pub fn childPreExec(self: Pty) !void { if (setsid() < 0) return error.ProcessGroupFailed; // Set controlling terminal - if (c.ioctl(self.slave, TIOCSCTTY, @as(c_ulong, 0)) < 0) - return error.SetControllingTerminalFailed; + switch (std.os.system.getErrno(c.ioctl(self.slave, TIOCSCTTY, @as(c_ulong, 0)))) { + .SUCCESS => {}, + else => |err| { + log.err("error setting controlling terminal errno={}", .{err}); + return error.SetControllingTerminalFailed; + }, + } // Can close master/slave pair now std.os.close(self.slave);