I use pane_current_path for new tmux panes and windows:

bind - split-window -c "#{pane_current_path}"

It works well, until I have a script running. pane_current_path gets set to $PWD of the subshell.

I check it like this:

display-message "#{pane_current_path}"

Is there a way to preserve $PWD of the top level shell?

I tried doing this:

bind - split-window -c "$PWD"

But this $PWD is from the shell that tmux was started in. So it doesn't update when I change directory inside tmux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.