当您在tmux正在运行的会话中启动新会话或在其中创建新窗口时,其默认行为是运行 shell(例如:)bash作为登录 shell。
我知道登录 shell 的目的是在您登录系统时执行您感兴趣的配置和过程的例行程序。但是在大多数情况下(除了可以tmux 用作登录 shell 的情况外),当用户只想打开一个新窗口时,这样做并不是用户的真正意图。
那么将其作为 的默认行为的理由是tmux什么?
文档中关于此事的唯一说明:
Run Code Online (Sandbox Code Playgroud)default-command shell-command Set the command used for new windows (if not specified when the window is created) to shell-command, which may be any sh(1) command. The default is an empty string, which instructs tmux to create a login shell using the value of the default-shell option.