mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 01:46:33 +00:00

Fixes #2432 On macOS, processes with an NSApplicationMain entrypoint do not have access to libc argc/argv. Instead, we must use NSProcessInfo. This commit introduces an args iterator that uses NSProcessInfo, giving us access to the args. This also fixes an issue where we were not properly skipping argv0 when iterating over the args. This happened to be fine because we happened to ignore invalid args but it introduces a config error.
45 lines
1.7 KiB
Zig
45 lines
1.7 KiB
Zig
//! The "os" package contains utilities for interfacing with the operating
|
|
//! system. These aren't restricted to syscalls or low-level operations, but
|
|
//! also OS-specific features and conventions.
|
|
|
|
const desktop = @import("desktop.zig");
|
|
const env = @import("env.zig");
|
|
const file = @import("file.zig");
|
|
const flatpak = @import("flatpak.zig");
|
|
const homedir = @import("homedir.zig");
|
|
const locale = @import("locale.zig");
|
|
const macos_version = @import("macos_version.zig");
|
|
const mouse = @import("mouse.zig");
|
|
const openpkg = @import("open.zig");
|
|
const pipepkg = @import("pipe.zig");
|
|
const resourcesdir = @import("resourcesdir.zig");
|
|
|
|
// Namespaces
|
|
pub const args = @import("args.zig");
|
|
pub const cgroup = @import("cgroup.zig");
|
|
pub const passwd = @import("passwd.zig");
|
|
pub const xdg = @import("xdg.zig");
|
|
pub const windows = @import("windows.zig");
|
|
|
|
// Functions and types
|
|
pub const CFReleaseThread = @import("cf_release_thread.zig");
|
|
pub const TempDir = @import("TempDir.zig");
|
|
pub const PATH_SEP = env.PATH_SEP;
|
|
pub const appendEnv = env.appendEnv;
|
|
pub const appendEnvAlways = env.appendEnvAlways;
|
|
pub const getenv = env.getenv;
|
|
pub const setenv = env.setenv;
|
|
pub const unsetenv = env.unsetenv;
|
|
pub const launchedFromDesktop = desktop.launchedFromDesktop;
|
|
pub const fixMaxFiles = file.fixMaxFiles;
|
|
pub const allocTmpDir = file.allocTmpDir;
|
|
pub const freeTmpDir = file.freeTmpDir;
|
|
pub const isFlatpak = flatpak.isFlatpak;
|
|
pub const home = homedir.home;
|
|
pub const ensureLocale = locale.ensureLocale;
|
|
pub const macosVersionAtLeast = macos_version.macosVersionAtLeast;
|
|
pub const clickInterval = mouse.clickInterval;
|
|
pub const open = openpkg.open;
|
|
pub const pipe = pipepkg.pipe;
|
|
pub const resourcesDir = resourcesdir.resourcesDir;
|