小智 6
就我而言,我有一个用户帐户只是为了运行一个脚本,因此我通过创建文件 ~/.tmux.conf 在该用户的主目录中提供默认的 tmux 配置
我的 ~/.tmux.conf 文件看起来(大致)像这样:
new-session -d -s MYSESSIONNAME
set -g status off
new-window ~/my-startup-script.sh
Run Code Online (Sandbox Code Playgroud)
显然,my-startup-script.sh 需要设置 +x 权限。
要启动 ~/.tmux.conf tmux 脚本,请发出命令
tmux start-server
Run Code Online (Sandbox Code Playgroud)