当tmux打开时,我希望它默认使用zsh而不是bash。我该如何做到这一点呢?
发布于 2014-04-27 13:51:41
来自man tmux
default-shell path Specify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable. When started tmux tries to set a default value from the first suitable of the SHELL environment variable, the shell returned by getpwuid(3), or /bin/sh. This option should be configured when tmux is used as a login shell.
所以,在你的tmux.conf中
# set shell
set -g default-shell /bin/zsh如果您愿意,您可以在每次启动新窗口时添加默认命令:
# Retach userspaces
set -g default-command "reattach-to-user-namespace -l zsh"发布于 2014-09-17 08:57:59
您可能希望zsh成为大多数情况下的默认shell (但这不适用于cron)。下面的代码将使zsh成为默认的shell,这样您就不需要告诉tmux任何东西了。
chsh -s /usr/bin/zsh请注意,一些操作系统仍然使用/bin/zsh作为zsh的路径。
发布于 2020-09-15 13:05:25
如果您喜欢为一个会话单独设置它,而不是为其他(将来)会话设置它,您可以使用
tmux new-session /bin/zsh \; set default-shell /bin/zshhttps://stackoverflow.com/questions/23318284
复制相似问题