命令完成后停止关闭 tmux 分离的会话

  • 本文关键字:tmux 分离 会话 命令 tmux
  • 更新时间 :
  • 英文 :


当我使用类似的东西启动一个新的、分离的 tmux 会话时

tmux new-session -d -s "newname" 'python my file.py'

一旦我的 Python 程序完成,TMUX 会话似乎就会从tmux ls中消失。我想回到壳里。我该怎么做?

使用send-keys在新窗口中的默认 shell 进程中运行脚本。

tmux new-session -d -s "new name"
tmux send-keys -t "new name:0" "python my file.py" Enter

最新更新