简单方法解决“The default interactive shell is now zsh”

    在早期的 Mac 系统中,默认的Shell是tcsh(Tenex C Shell),在 Mac OS X 10.3 Panther 版本左右开始将默认 shell 改为 bash,而在macOS 的 Catalina(10.15)版本又将默认 shell 改为了 zsh。

    当习惯于Bash且暂时不打算切换到zsh时,就会将默认的zsh改回bash。修改的方法大致有两种,一种是通过“系统偏好设置”来修改,一种是通过命令行修改。

通过系统偏好设置:

    1. 点击苹果按钮,选择“系统偏好设置”(System Setting);

    2. 点击“用户与群组”(Users & Groups);

    3. 右键点击要操作的用户,再点“高级选项”(Advanced Options),并输入密码解锁;

    4. 在弹出的界面点击“登陆Shell”(Login shell),选择“/bin/bash”后点击“OK”;

通过命令行:

chsh -s /bin/bash

    修改后系统默认的Shell即被修改为Bash。由于macOS初始默认的Shell是zsh,被修改为Bash后,会在每次启动新的Terminal窗口时显示提示信息“The default interactive shell is now zsh.”。这虽然不会对操作有实质上的影响,但频繁的提示有时会令人不爽,经过仔细查询后,在MacPaw Blog上找到了隐藏提示信息的方法,就是在.bashrc或.bash_profile中添加如下环境变量:

export BASH_SILENCE_DEPRECATION_WARNING=1

参考:What to do with “The default interactive shell is now zsh”If you’ve just upgraded macOS and seen a message that says, “The default interactive shell is now zsh,” we’ll tell you why and what to do about it.https://macpaw.com/how-to/default-interactive-shell-now-zsh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值