LoginSignup
43
26

More than 5 years have passed since last update.

tmuxで新しいペインを開いた時に同じディレクトリで開くようにする

Last updated at Posted at 2014-06-05

問題: tmux 1.9からは毎回ホームディレクトリが開くようになった

バージョン1.8まではC-b cで新しいペインを開いた時に、コマンドを送信したペインと同じディレクトリでペインが開いていました。

しかし、v1.9からは仕様が変わり、ホームディレクトリが開くようになりました。

tmux 更新履歴

解決策: 設定を変えて同一のディレクトリを開くようにする

バージョン1.8以前の挙動に戻したい場合は、.tmux.confに以下のような設定を追加します。

tmux.conf
bind c new-window -c '#{pane_current_path}'

さらに: ペイン分割時も同一ディレクトリで開くようにする

ペインを分割して開いた時も同一ディレクトリで開くようにする場合は、以下のように設定します。

tmux.conf
bind '"' split-window -c '#{pane_current_path}'
bind % split-window -h -c '#{pane_current_path}'
43
26
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
43
26