config: restore window-inherit-working-directory defaults

This setting previously defaulted to `true`, so flip all of our packed
booleans on by default.

Also, note that the granular values are only supported on macOS.
This commit is contained in:
Jon Parise
2024-04-17 21:52:11 -07:00
parent f5ddb36c94
commit 834fe8d7f6

View File

@ -687,9 +687,11 @@ keybind: Keybinds = .{},
/// focused, the default working directory will be used (the `working-directory` /// focused, the default working directory will be used (the `working-directory`
/// option). /// option).
/// ///
/// Value value are `split`, `tab`, and `window`. You can specify multiple /// Valid values are `split`, `tab`, and `window`. You can specify multiple
/// values using a comma-delimited string (`tab` or `split,window`). You /// values using a comma-delimited string (`tab` or `split,window`). You
/// can also set this to `true` (always inherit) or `false` (never inherit). /// can also set this to `true` (always inherit) or `false` (never inherit).
///
/// `split`, `tab`, and `window` are currently only supported on macOS.
@"window-inherit-working-directory": WindowInheritWorkingDirectory = .{}, @"window-inherit-working-directory": WindowInheritWorkingDirectory = .{},
/// If true, new windows and tabs will inherit the font size of the previously /// If true, new windows and tabs will inherit the font size of the previously
@ -3750,9 +3752,9 @@ pub const WindowNewTabPosition = enum {
pub const WindowInheritWorkingDirectory = packed struct { pub const WindowInheritWorkingDirectory = packed struct {
const Self = @This(); const Self = @This();
split: bool = false, split: bool = true,
tab: bool = false, tab: bool = true,
window: bool = false, window: bool = true,
pub fn parseCLI(self: *Self, _: Allocator, input: ?[]const u8) !void { pub fn parseCLI(self: *Self, _: Allocator, input: ?[]const u8) !void {
const value = input orelse return error.ValueRequired; const value = input orelse return error.ValueRequired;
@ -3769,7 +3771,7 @@ pub const WindowInheritWorkingDirectory = packed struct {
} }
// Enable all of the fields named in the comma-separated value. // Enable all of the fields named in the comma-separated value.
self.* = .{}; self.* = .{ .split = false, .tab = false, .window = false };
var iter = std.mem.splitSequence(u8, value, ","); var iter = std.mem.splitSequence(u8, value, ",");
loop: while (iter.next()) |part_raw| { loop: while (iter.next()) |part_raw| {
const part = std.mem.trim(u8, part_raw, whitespace); const part = std.mem.trim(u8, part_raw, whitespace);