tmux-plugins / tmux-sensible

basic tmux settings everyone can agree on
MIT License
1.73k stars 90 forks source link

config proposal: bring back 'new shell in the current dir' function #32

Closed ershov closed 7 years ago

ershov commented 8 years ago

Hi,

Starting new shells and other commands in the current directory is the most valuable capability of terminal emulators for me. Unfortunately, somewhere in transit between 1.8 and 1.9 tmux lost this cool function without any reason.

My proposal it to restore it by changing the bindings for 'new window' and 'split-pane' and add -c #{pane_current_path} to bring it back.

My guess is this should not hurt anyone because this is the behavior users used to in older tmux versions (which are still shipped with Ubuntu and many other distros) and I know lots of people suffer they lost it after update.

Thank you in advance, Yury

sersorrel commented 7 years ago

If anyone else wants this behaviour, these are the lines to add to .tmux.conf:

bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"

This will make new panes open in the current directory, but new windows will still open in the directory tmux was started from. Bind the new-window command if you want new windows to open in the current directory too.

bruno- commented 7 years ago

Hey guys, why don't you give tmux-pain-control a look? It has these binding defined.