tmux Tips

Some tmux tips.

Make Two Panes Take Full Screen Side by Side

Scenario: I have one tmux session with one window opening, in which five panes takes the window’s screen. I finish my coding and try to commit the code to git. While submitting, I want to two panes occupy full tmux screen side by side – one is for git diff, the other is for git add.

Solution: Create a new temporary window. Use join-pane to move an existing pane into the new window. Now two panes are side by side in the new window, do your git diff and git add. When finish, use join-pane to move the pane back. And if you like, kill the newly created window.

All following commands should follow prefix key, C-b.

# create a new temp window 
c

# list all panes in the session
# you will find pane index in command output, like '0.0', 
#   which means the first pane of the first window                       
:list-panes -s     

# move a pane into another pane
# -h makes two pane position horizontally    
# -s specifies source pane, -t for dest pane
:join-pane -h -s 0.0 -t 1.0

# do your job ...

# move the pane back to previous window
:join-pane -s 1.1 -t 0.0

# kill the temp window
:kill-window -t 1
2016-07-13 20:36
推荐到豆瓣

如果你觉得这篇文章对你有用,可以微信扫一扫表示🙏 / If you find this post is useful to you, buy me 🍶 via Wechat