LoginSignup
2
2

More than 5 years have passed since last update.

tmuxで表示するウィンドウ名の長さを制限する

Last updated at Posted at 2015-08-24

tmuxでウィンドウ名がやたら長くなってしまったときに、ステータスラインに表示する文字数を制限する方法です。

$ tmux -V
tmux 2.0

manページを見てみるとFORMATSの項に書いてありますが、'#{=10:pane_tilte}'のようにすれば、pane_titleの最初の10文字のみを含むようにできます。

ということで、自分の場合は

setw -g window-status-format "#[fg=white] #I:#{=20:window_name} "
setw -g window-status-current-format "#[fg=colour234,bg=colour248,bold] #I:#{=20:window_name} "

のようにすることで、ウィンドウ番号と、ウィンドウ名の最初の20文字をステータスラインに表示するようにしました。

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