When I open a new tab (via ⌘T) on a remote shell using iTerm2 and tmux, I almost always want the new tab to have the same working directory as the current tab. The best I can do is make iTerm2 open up the new tab in the same directory in which I ran tmux -CC
or tmux -CC attach
. (This behavior can be configured by navigating to Preferences → Profiles → General → Working Directory.)
This directory will not necessarily be the working directory of the current tab. Is there any way to get the behavior I'm looking for? I searched online for a while but could not find any helpful information.