Skip to content

Commit

Permalink
config: restore window-inherit-working-directory defaults
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jparise committed May 5, 2024
1 parent 3bc0832 commit 22403b5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/config/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,11 @@ keybind: Keybinds = .{},
/// focused, the default working directory will be used (the `working-directory`
/// 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
/// 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 = .{},

/// If true, new windows and tabs will inherit the font size of the previously
Expand Down Expand Up @@ -3487,9 +3489,9 @@ pub const WindowNewTabPosition = enum {
pub const WindowInheritWorkingDirectory = packed struct {
const Self = @This();

split: bool = false,
tab: bool = false,
window: bool = false,
split: bool = true,
tab: bool = true,
window: bool = true,

pub fn parseCLI(self: *Self, _: Allocator, input: ?[]const u8) !void {
const value = input orelse return error.ValueRequired;
Expand All @@ -3506,7 +3508,7 @@ pub const WindowInheritWorkingDirectory = packed struct {
}

// 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, ",");
loop: while (iter.next()) |part_raw| {
const part = std.mem.trim(u8, part_raw, whitespace);
Expand Down

0 comments on commit 22403b5

Please sign in to comment.