问题
I get a wrong username format when I launch my terminal. As a newbie, I could notice three errors: 1. a closed bracket ] appears instead of a colon 2. the $ sign is not followed by a single space 3. the first letter or character typed doesn't appear, for e.g. if I type ls, only the s would appear
Username: mymac, Computer name: MyMac’s MacBook Air
This is a screenshot
回答1:
The extra ]
can be disabled by :
- opening the terminal
- selecting
edit
menu bar - hovering over
marks
- unchecking
automatically mark prompt lines
The default can be overridden by executing the following command:
echo 'export PS1="\\u@\h \W $ "' >> ~/.bash_profile
Reference: https://superuser.com/questions/974714/previous-commands-wrapped-with-square-brackets-in-os-x-terminal
来源:https://stackoverflow.com/questions/57626014/how-to-fix-mac-terminal-username-format-missing-colon-and-no-spacing-after-the