doyunamic
doyunamic

Reputation: 23

MacOS(Catalina) terminal bash looks weird

enter image description here

I just have installed Catalina on my imac, and I saw a terminal bash looks weird. It should be ~$ but my terminal shows ~% Can anyone change this uncommon line(~%) to a normal line(~$)? Thank you in advance

Upvotes: 1

Views: 2166

Answers (2)

Vishnu Agarwal
Vishnu Agarwal

Reputation: 39

For a long time, the bash was a default shell in macOS. However, Apple replaced Bourne Again SHell with Z shell for licensing reasons

Set default shell to bash on Macos Catalina. The procedure is as follows:

  1. Open the terminal application.
  2. List available shells by typing cat /etc/shells.
  3. To update your account to use bash run chsh -s /bin/bash.
  4. Close terminal app.
  5. Open the terminal app again and verify that bash is your default shell.

Upvotes: 3

crdrisko
crdrisko

Reputation: 484

You can set your PS1 variable in your .bashrc, .bash_profile, or .profile to whatever you want. For example:

export PS1=“\h \W $ “

Will give your hostname, current working directory, followed by the $ you wanted. This can be customized however you like, see this link for a good description.

Also, as chepner mentioned in the comments, you need to set your default shell back to bash. I believe the easiest thing to do is go into your terminal settings, and change your shell:

Terminal > Preferences... > General > Shells open with: Command (complete path): /bin/bash

Upvotes: 3

Related Questions