config: add option to disable working directory inheritance

Fixes #618
This commit is contained in:
Mitchell Hashimoto
2023-10-05 21:55:43 -07:00
parent 7d0789edfc
commit e74897fa01
2 changed files with 10 additions and 2 deletions

View File

@@ -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;
}
}
}