Skip to content

Conversation

@peterguy
Copy link
Contributor

@peterguy peterguy commented Oct 12, 2025

Closes 1392

Add two boolean config settings:

  • tab-inherit-working-directory
  • split-inherit-working-directory

They mimic the existing window-inherit-working-directory, and it's interaction with working-directory.

This allows users to configure working directory inheritance independently for new tabs, windows, and split panes,
providing maximum flexibility for different workflow patterns.

Sample config entries

window-inherit-working-directory = false
tab-inherit-working-directory = true
split-inherit-working-directory = true

Authored with Amp
Relevant threads:

Behavior in macOS
https://share.cleanshot.com/7LsSGM53

Behavior in linux (Ubuntu)
https://share.cleanshot.com/qJf3Hp6w

@peterguy peterguy marked this pull request as ready for review October 12, 2025 16:28
@peterguy peterguy requested review from a team as code owners October 12, 2025 16:28
@peterguy
Copy link
Contributor Author

I consolidated the enums; it builds and tests fine on macOS. My Linux VM is not building it currently - hangs on this step:

[186/191] steps
├─ run exe gbp (gbp.bin.z)
└─ run exe dwp (dwp.bin.z)

I'm working on getting Nix set up, but it's being recalcitrant.

If someone can try a build on Linux, let me know if it works (or not) for them.

@jcollie
Copy link
Member

jcollie commented Oct 14, 2025

I consolidated the enums; it builds and tests fine on macOS. My Linux VM is not building it currently - hangs on this step:

Are you using Zig 0.15.2 or 0.15.1? I believe that this is caused by breakage in zg caused by 0.15.2. You should either downgrade Zig to 0.15.1 or rebase your work on the latest main as the last thing that depended on zg was updated this morning.

@peterguy
Copy link
Contributor Author

peterguy commented Oct 14, 2025

Are you using Zig 0.15.2 or 0.15.1?

0.15.2 0 - that's the version snap has.

Installed 0.15.1 via tarball and zig build behaves now.

Thanks for the pointer - I hadn't gotten to the point of questioning the version of zig yet. 🤦

@peterguy
Copy link
Contributor Author

Got zig build working on Linux (Ubuntu) using 0.15.1, and the enum consolidation tests out ok.

@peterguy peterguy force-pushed the inherit-cwd branch 3 times, most recently from 16a3435 to cba1cef Compare October 17, 2025 00:15
- Define NewSurfaceContext enum (window, tab, split)
- Add shouldInheritWorkingDirectory helper function
- Thread surface context through newConfig and newSurfaceOptions
- Replace window-inherit-working-directory checks with context-aware logic
- Add context to embedded CAPI and GTK Surface structs
- Define NewSurfaceContext to match the Zig enum name and avoid magic numbers.
In order to set the private context variable so that initiSurface can use it.
(which should inherit based on the window setting),
and a new tab in an existing window
(which should inherit base on tab setting)
functions back into a single function with a second parameter for the source context.
@peterguy
Copy link
Contributor Author

@pluiedev thanks for the good feedback; can you take a look at the changes I made?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow different window-inherit-working-directory behavior for tabs and windows

3 participants