LoginSignup
29
21

More than 5 years have passed since last update.

tmux で 一時拡大の resize-pane -Z が便利。(ver1.8以降)

Last updated at Posted at 2016-02-17

tmux でターミナルを分割して使っている時に、一時的に大きくしたい時とかありますよね。
一時的に man みたいとか、出力結果を less で見たいとか、過去の出力結果を遡ってみたいとか。

そんな時には [prefix] z で拡大できます。

tmux_resizepane.gif

拡大中は Window の名前に「*Z」が追加されて 「zsh*Z」 などに名前が変わるので、
Zoom 中で他にも pane があるということが認識できる。

元に戻すときにも同じで [prefix] z

ちなみに、タイトルにかかれている様に、version 1.8 で搭載された機能です。

tmux の version に関しては
  mac だと brew で 2.1
  Cent6 系で rpmforge 使っている人は 1.6
  Cent7 系は 1.8
  fedora23 は 2.0
なのかな。(2016.2 現在)

Cent6 系でこの機能を使いたい人は以下のような形でアップデートが必要。
以下は Cent6.5 で tmux1.9a のインストールだけど、
参考元のコメントでは、他バージョンでも動作している模様

# Install tmux on Centos release 6.5
yum install gcc kernel-devel make ncurses-devel

# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make
sudo make install

# DOWNLOAD SOURCES FOR TMUX AND MAKE AND INSTALL
curl -OL http://downloads.sourceforge.net/tmux/tmux-1.9a.tar.gz
tar -xvzf tmux-1.9a.tar.gz
cd tmux-1.9a
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
make
sudo make install

参考元
https://gist.github.com/rothgar/cecfbd74597cc35a6018

この機能が出る前は 別 windows 開いたり、[prefix] ! の break-pane とかで、
別 Window にしたりしていたけど、resize-pane -Z のほうが使い勝手がいいかな。

ちなみに、2.1 系からは mouse 関連のオプションが変わっているので、
.tmux.conf に mouse 関連のことを記載している人は変更が必要。

29
21
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
29
21