我试图与屏幕做到这一点。我能想到的最好的办法是有多个会话(使用不同的转义字符)。多个日志窗口全部在一个会话中,另一个会话在一个窗口中包含屏幕-r日志。然后我可以拆分日志会话,并且仍然可以循环访问其他会话窗口。
我相信它可能在tmux中,但我还没有做出开关(还)。
编辑:这绝对是可能的,并且非常容易,在tmux中。而且这个开关非常简单(我开始的时候在tmux例子中有一个screen-keys.conf文件)。这是我写的用3个窗口创建全屏会话的脚本,第三个窗格中有3个窗格,一个20%,另外两个40%。这是一个从crontab中调用的:@reboot
tmux new-session -d -s base /bin/bash
tmuxwin() {
tmux new-window -t base -n $1 /bin/bash
sleep 1
shift
tmux send "$1" C-m
}
tmuxwin second "echo second"
# These all end up in one window
tmuxwin thirddotone "echo 3.1"
tmuxwin thirddottwo "echo 3.2"
tmuxwin thirddotthree "echo 3.3"
# join 3.1 to 3.2. Give 3.1 20%
tmux select-window thirddotone
tmux joinp -p 80 -s +
# join 3.3 to 3.2. Even split
tmux joinp -s +
# and fix the names...
tmux rename-window three
# I am waiting for you, Vizzini. You told me to go back to the beginning.
# So I have. This is where I am, and this is where I’ll stay. I will not be moved.
tmux select-window -t 0
所以我的建议是切换到TMUX。我一直在使用tmux的时间不到一个星期,并没有回头。
来源
2013-12-24 13:12:39
mlv