【问题标题】:Bash script for tmux managing用于 tmux 管理的 Bash 脚本
【发布时间】:2015-02-08 10:30:13
【问题描述】:

我想从终端启动tmux,拆分它的窗口并在拆分中执行一些命令。此外,我想使用从终端开始的 bash 脚本。现在,我只能启动tmux

#!/bin/sh

tmux

# How to split tmux window there, and start commands in splits?

【问题讨论】:

标签: bash scripting automation tmux


【解决方案1】:

有一个脚本从 tmux 开始,拆分为多个窗格,并在左侧窗格中启动 ls,在右侧窗格中启动 top

#!/bin/sh

tmux new-session -d -s main ;
tmux split-window -h ;
tmux select-pane -L
tmux send-keys -t main 'ls' C-m
tmux select-pane -R
tmux send-keys -t main 'top' C-m
tmux attach-session -d -t main 

【讨论】:

    猜你喜欢
    • 2014-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-23
    • 2015-03-26
    • 2021-08-01
    相关资源
    最近更新 更多