Background
I'm using tmux 2.0, Ubuntu 14.04.2 LTS in VirtualBox.
In order to make tmux open new windows with the same path as the current window I added this line to my ~/.tmux.conf
file:
bind c new-window -c "#{pane_current_path}"
Note that in tmux, if I cd
from home to a subdirectory via a symlink, then check pwd
and pwd -P
I get:
~$ cd pythons
~/pythons$ # An awesome prompt
~/pythons$ pwd # According to "man pwd" this shows the "logical" path
/home/qiime/pythons
~/pythons$ pwd -P # and this shows the "physical" path
/media/sf_Google_Drive/Home/Programs/Pythons
The problem is
If I open a new tmux window while in ~/pythons
the new bash prompt takes on the physical path:
/media/sf_Google_Drive/Home/Programs/Pythons$ # Not an awesome prompt
Q: Yes, it's opened to the correct directory... but is there a way to get tmux to start bash with the logical path instead of the full-blown physical path?
Alternatively, perhaps there is something I can add to .bashrc
to make this happen?
Edit:
To check if any config settings are causing this issue I tried commenting out all lines in ~/.tmux.conf
except for
bind c new-window -c "#{pane_current_path}"
but I still get the full physical path. I also tried echo
ing the current (logical) path from the top of my ~/.bashrc
file. Unfortunately, this echos the ugly physical path of the parent window, which apparently has become the new window's physical and logical path. So tmux 2.0 must be passing it to the new bash instance via the value of "#{pane_current_path}"
Moreover, I just found this recently opened tmux issue: pane_current_path doesn't agree with pane's PWD #33 indicating that this behavior originates in tmux code.
Q: So maybe my question should be, Is there a workaround?
.bashrc
or other sourced files.~/.tmux.conf
?~/.tmux.conf
doesn't contain anything fancy but I did check if it was a problem. Please see edit above.