Merge pull request #1956 from ghostty-org/gtk-e-flag

config: `-e` CLI flag automatically implies `gtk-single-instance=false`
This commit is contained in:
Mitchell Hashimoto
2024-07-17 11:21:26 -07:00
committed by GitHub

View File

@ -432,7 +432,9 @@ palette: Palette = .{},
///
/// If you're using the `ghostty` CLI there is also a shortcut to run a command
/// with arguments directly: you can use the `-e` flag. For example: `ghostty -e
/// fish --with --custom --args`.
/// fish --with --custom --args`. The `-e` flag also automatically sets
/// `gtk-single-instance = false` (no matter what) to ensure that a new
/// instance is launched and the CLI args are respected.
command: ?[]const u8 = null,
/// If true, keep the terminal open after the command exits. Normally, the
@ -2095,6 +2097,11 @@ pub fn parseManuallyHook(self: *Config, alloc: Allocator, arg: []const u8, iter:
self.command = command.items[0 .. command.items.len - 1];
// When "-e" is used on the command line then we always disabled
// single instance mode because single instance mode is incompatible
// with CLI flags.
self.@"gtk-single-instance" = .false;
// Do not continue, we consumed everything.
return false;
}