diff --git a/src/apprt/surface.zig b/src/apprt/surface.zig index 1cf303888..c7ebc6ac8 100644 --- a/src/apprt/surface.zig +++ b/src/apprt/surface.zig @@ -79,8 +79,10 @@ pub fn newConfig(app: *const App, config: *const Config) !Config { // Get our previously focused surface for some inherited values. const prev = app.focusedSurface(); if (prev) |p| { - if (try p.pwd(alloc)) |pwd| { - copy.@"working-directory" = pwd; + if (config.@"window-inherit-working-directory") { + if (try p.pwd(alloc)) |pwd| { + copy.@"working-directory" = pwd; + } } } diff --git a/src/config/Config.zig b/src/config/Config.zig index 64f39dd9e..12c235f6c 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -309,6 +309,12 @@ keybind: Keybinds = .{}, /// to balance the padding given a certain viewport size and grid cell size. @"window-padding-balance": bool = false, +/// If true, new windows and tabs will inherit the working directory of +/// the previously focused window. If no window was previously focused, +/// the default working directory will be used (the "working-directory" +/// option). +@"window-inherit-working-directory": bool = true, + /// If true, new windows and tabs will inherit the font size of the previously /// focused window. If no window was previously focused, the default /// font size will be used. If this is false, the default font size