Merge pull request #620 from mitchellh/window-inherit-wd

config: add option to disable working directory inheritance
This commit is contained in:
Mitchell Hashimoto
2023-10-05 22:18:26 -07:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@ -79,10 +79,12 @@ pub fn newConfig(app: *const App, config: *const Config) !Config {
// Get our previously focused surface for some inherited values. // Get our previously focused surface for some inherited values.
const prev = app.focusedSurface(); const prev = app.focusedSurface();
if (prev) |p| { if (prev) |p| {
if (config.@"window-inherit-working-directory") {
if (try p.pwd(alloc)) |pwd| { if (try p.pwd(alloc)) |pwd| {
copy.@"working-directory" = pwd; copy.@"working-directory" = pwd;
} }
} }
}
return copy; return copy;
} }

View File

@ -309,6 +309,12 @@ keybind: Keybinds = .{},
/// to balance the padding given a certain viewport size and grid cell size. /// to balance the padding given a certain viewport size and grid cell size.
@"window-padding-balance": bool = false, @"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 /// If true, new windows and tabs will inherit the font size of the previously
/// focused window. If no window was previously focused, the default /// focused window. If no window was previously focused, the default
/// font size will be used. If this is false, the default font size /// font size will be used. If this is false, the default font size