I am new to tmux and I am trying to edit my tmux.conf file to have the left side of the status bar reflect:
[SessionName] [CurrentPane] [CurrentWorkingDirectory]
I am able to display the SessionName
and CurrentPane
. However I can't get to display the CurrentWorkingDirectory
.
I've tried several #(shell command)
options:
#(tmux select-pane -t :.#P; pwd)
: But this prints some other $PWD variable which does NOT reflect the current directory of the bash session in the current pane.#(tmux select-pane -t :.#P; tmux send-keys pwd Enter)
Firstly, although it did print theCurrentWorkingDirectory
if I'm in a terminal. It prints this in the terminal and NOT in the status bar like how I want it. Secondly, It entered "pwd Enter" every 15 seconds whether or not I was in a terminal, which was a hassle to reverse if your not as quick (like I am).
I've tried these options but to no avail, is it possible to do what I want? and how?