LoginSignup
7
5

More than 5 years have passed since last update.

【TMUX】新しいWindowを開いたときに、直前のカレントディレクトリを引き継ぐ設定

Last updated at Posted at 2018-11-05

自分のブログの投稿内容になります。*


TMUXでWindowを開くたびに直前のカレントディレクトリに cd することが多く、面倒だったので調べてみた。

環境

自分のTMUX環境を確認

# tmux -V
tmux 2.8

設定

以下の設定を ~/.tmux.conf に追記すればOK。

vi ~/.tmux.conf
# 新しいPaneを開く場合
bind c new-window -c '#{pane_current_path}'
# 現在のPaneを水平分割してWindowを開く
bind \ split-window -h -c '#{pane_current_path}'
# 現在のPaneを垂直分割してWindowを開く
bind - split-window -v -c '#{pane_current_path}'

すでにTMUXプロセスが起動中の場合は、以下のコマンドを実行しないと正しく反映されないことに注意!

tmux source-file ~/.tmux.conf
7
5
0

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
7
5