首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将tmux默认值更改为zsh

将tmux默认值更改为zsh
EN

Stack Overflow用户
提问于 2014-04-27 09:12:21
回答 3查看 22.1K关注 0票数 32

当tmux打开时,我希望它默认使用zsh而不是bash。我该如何做到这一点呢?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 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

代码语言:javascript
运行
复制
# set shell
set -g default-shell /bin/zsh

如果您愿意,您可以在每次启动新窗口时添加默认命令:

代码语言:javascript
运行
复制
# Retach userspaces
set -g default-command "reattach-to-user-namespace -l zsh"
票数 50
EN

Stack Overflow用户

发布于 2014-09-17 08:57:59

您可能希望zsh成为大多数情况下的默认shell (但这不适用于cron)。下面的代码将使zsh成为默认的shell,这样您就不需要告诉tmux任何东西了。

代码语言:javascript
运行
复制
chsh -s /usr/bin/zsh

请注意,一些操作系统仍然使用/bin/zsh作为zsh的路径。

票数 8
EN

Stack Overflow用户

发布于 2020-09-15 13:05:25

如果您喜欢为一个会话单独设置它,而不是为其他(将来)会话设置它,您可以使用

代码语言:javascript
运行
复制
 tmux new-session /bin/zsh \; set default-shell /bin/zsh
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23318284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档