"C-a c" new behavior
vimeitor opened this issue · comments
Hello,
Since tmux 1.9 got out, the behavior of "C-a c" has changed. It used to create a new window in the same directory as the current window; now, instead, it creates a new window in home. I'm not really sure if people would like to get the same behavior as before or they are fine with the current one, but I've personally added the following keybinding:
bind c new-window -c '#{pane_current_path}'
You might want to consider it :).
Take care and thank you for your effort with the project,
Adria
@vimeitor Would you like to make a pull request for this?
Sure. The problem is the fact that, if I'm not mistaken, distros like Ubuntu are still using tmux 1.8.5. I will have to test this with older versions, as I don't want to break anything.
@vimeitor : This is true, maybe if-shell
could do the trick. Still want to try the PR?
I looked around, @edkolev's tmux.conf at https://github.com/edkolev/dots/blob/master/tmux.conf has some useful config settings.
@edkolev: Do you mind if we borrow some of your tmux.conf and credit you? Especially:
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind c; bind c new-window -c "#{pane_current_path}"'
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind s; bind s split-window -v -c "#{pane_current_path}"'
if-shell "[[ `tmux -V` == *1.9* ]]" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
# local conf
if-shell "test -f ~/.tmuxlocal.conf" "source ~/.tmuxlocal.conf"
# colors
if-shell "test -f ~/.tmuxcolors.conf" "source ~/.tmuxcolors.conf"
Please, go ahead. Don't bother giving me credit if that would be too much hassle for you :)
I'm closing this since I see you already pushed the changes :).
Thank you.