Change Command Prompt in new Z Shell

Hello. I would like to change the terminal prompt in the new Catalina terminal app to just the full path and the $. Can someone please walk me through it? And maybe point me to a list of other comman prompt variables. Thanks.

Mac mini, macOS 10.15

Posted on Nov 7, 2019 12:04 AM

Reply

Similar questions

3 replies

Nov 22, 2019 9:50 AM in response to Faszikam

Additional, and optional to MrHoffman's post, you may find that the Zsh colors module has washed out colors, and you may prefer a more vibrant prompt. Here is what I did in my ~/.zprofile and ~/.zshrc files:


TPUT="/usr/bin/tput"
GREEN="$(${TPUT} bold; ${TPUT} setaf 42)"
WHITE="$(${TPUT} bold; ${TPUT} setaf 15)"
# don't let VPN DNS servers change prompt hostname
MyHost="$(networksetup -getcomputername)"
PS1="${GREEN}${MyHost}: %~ %% ${White}"


This gives an all green Zsh prompt with white command text in a black Terminal window.


Without installing the Python script at the following link, you can see all of the 256 decimal and hexadecimal color values in tables presented on the website, if you want to experiment with different prompt colors.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Change Command Prompt in new Z Shell

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.