gpt4 book ai didi

zsh - 将 tmux 默认更改为 zsh

转载 作者:行者123 更新时间:2023-12-02 03:24:56 24 4
gpt4 key购买 nike

当 tmux 打开时,我希望它默认使用 zsh 而不是 bash。我该如何实现这个目标?

最佳答案

来自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"

关于zsh - 将 tmux 默认更改为 zsh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23318284/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com