新建一个终端窗口显示如下
Last login: Fri Apr 1 16:53:24 on ttys002
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
查看终端的打印格式
$ echo $PS1
\h:\W \u\$
执行命令 chsh -s /bin/zsh 然后新开窗口
Last login: Fri Apr 1 16:53:43 on ttys003
查看终端的打印格式
% echo $PS1
%n@%m %1~ %#
执行命令查询.zshrc % cat .zshrc
再切换interactive shell 为base % chsh -s /bin/bash
同样新建命令窗口结果如下
Last login: Fri Apr 1 16:56:50 on ttys004
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
cat .bash_profile

本文介绍了如何在MacOS的终端窗口中切换$和%的显示,通过查看终端打印格式,执行特定命令修改.zshrc配置,并切换交互式shell为base,使得新开的命令窗口显示一致。

5036

被折叠的 条评论
为什么被折叠?



