Using split-window
& new-window
in tmux to create new panes & windows seems to be ignoring any use of the -c
(start-directory) flag.
I've tried binding this to %
in my ~/.tmux.conf
& manually entering it as a command inside tmux at the prompt by hitting prefix :
.
My intention is to set it to always use my current $PWD by binding the keys like this:
unbind %
bind % split-window -h -c "#{pane_current_path}"
unbind '"'
bind '"' split-window -h -c "#{pane_current_path}"
but it doesn't seem to matter what argument I pass to -c
, tmux just opens the new pane or window at my home directory.
I'm running tmux v2.6 on Ubuntu 18.04 accessed via ssh. Here's the contents of my /home/andrew/.tmux.conf
file:
# bind new panes to same path as active pane
# horizontal split
unbind %
bind % split-window -h -c "/home/andrew/dev/py-spec" # I've also tried "#{pane_current_path}" here as well, but neither works
# vertical split
unbind '"'
bind '"' split-window -v -c "/home/andrew/dev/py-spec" # I've also tried "#{pane_current_path}" here as well, but neither works
tmux
are you using? I'm on v2.6.$ tmux -V
returnstmux 2.6
, so we're the same version. I'm accessing the ubuntu computer with tmux on it over ssh; could that somehow make a difference?%
and"
correctly.bind-key
as well; I can't even get it to recognize anything when I manually give thesplit-window -h -c '/some/path/here'
command in the prompt too by hittingCtrl-B
, then:
.