When using Terminal under a recent macOS version, you’ll most likely will be using Z-Shell (zsh) –  a quite common Shell found under Linu

Custom z-Shell prompt

submited by
Style Pass
2022-05-14 04:00:04

When using Terminal under a recent macOS version, you’ll most likely will be using Z-Shell (zsh) –  a quite common Shell found under Linux as well. This used to be Bash, but Apple moved to Z-Shell early 2019 (some users may see a message when opening Terminal, requesting them to migrate to zsh).

Note: most of these tricks/settings may work the same way for different shells as well, like Bash and even Linux shell variants.

Please consider disabling your ad blocker for our website. We rely on these ads to be able to run our website. You can of course support us in other ways (see Support Us on the left ).

1 Why Customize Z-Shell Prompt?2 Temporary vs Permanent Custom Z-Shell promptTemporary custom Z-Shell PromptPermanent custom Z-Shell PromptBack to the default Z-Shell Prompt3 Custom Z-Shell prompt definitionDynamic Prompt ElementsVisual ElementsPlacing Text on the Far Right4 Color Cheat Sheet5 Some ExamplesCurrent time and Current Directory short Current Directory left and clock on the rightTime and directory with more colors6 Bonus TipsChanging the Cursor in Z-ShellSuppressing the Welcome Message

In my opinion, some of this default info is of little use to me. I already know it’s me that is logged in (I’m the only user anyway), and I know the hostname of my Mac (and rarely even use it).

Leave a Comment