bash - MacOS(Catalina)终端 bash 看起来很奇怪
问题描述
我刚刚在我的 imac 上安装了 Catalina,我看到终端 bash 看起来很奇怪。应该是~$,但我的终端显示~% 谁能把这条不常见的行(~%)改成普通行(~$)?先感谢您
解决方案
您可以将 .bashrc、.bash_profile 或 .profile 中的 PS1 变量设置为您想要的任何值。例如:
导出 PS1=“\h \W $”</p>
将给出您的主机名、当前工作目录,然后是您想要的 $。这可以根据您的喜好进行定制,请参阅此链接以获得良好的描述。
此外,正如评论中提到的 chepner,您需要将默认 shell 设置回 bash。我相信最简单的做法是进入您的终端设置,然后更改您的外壳:
Terminal > Preferences... > General > Shells open with: Command (complete path): /bin/bash
推荐阅读
- php - 如何从数据库编辑已填充的单选按钮
- php - 你如何在 VSCode 中使用 PHPUnit?
- php - 如何在 Laravel 代码中包含 HTML 按钮
- google-ads-api - GEO_PERFORMANCE_REPORT 查询为空
- java - 嗨,我如何从 selenium 中的 URL 获取响应令牌
- javascript - 从下拉代码点火器中选择选项后显示数据
- python-3.x - 将字符串中给出的工资值转换为数字,同时使用 python 确保所有值在数据库中的相同单位
- javascript - React Native 将数据传递到模态
- javascript - 在 vue、javascript、html 和 css 中单击时突出显示
- python - TypeError:在更新 Conda 时,“PrefixRecord”和“PackageRecord”的实例之间不支持“<”