Tired of a long prompt in zsh? Or worse, upgrading from macOS 10.14- with a customized bash prompt, and zsh is harshing your minimalist terminal vibe? Read on to find out how to fix it, and how to understand the steps you're going to take!
If you're anything like me, you were previously a physics tutor at your local community college. At this community college the physics department insisted on teaching students to write math equations for lab reports with an arcane software "MathType" which was only available for use by copying it off of a machine in the lab and onto your local. And (again β if you're anything like me) then you caught wind macOS 10.15 "Catalina" was breaking the compatibility with that dinosaur of a program.
This was, of course, unacceptable: Each semester without fail you needed to do a ~20 minute presentation on various occassions to divulge the spells (keyboard shortcuts) and potions (font settings) needed to craft beautifully typeset equations for lab reports than only two sets of eyes would ever view.
And so (if you are a n y t h i n g like me) you opted to go without software updates for two years. That's right. You kept your production machine vulnerable to two years worth of juicy zero-day and known exploits, just to pass on the tradition of wizardry in a program that almost no one benefits from, and absolutely no one needs (ahem⦠LaTeX).
In any case, upon graduation you may have decided that having such a vulnerable machine while attending school online might not be the best course of action, and so you finally upgraded from OSX to the shiny, at the time new macOS "Big Sur". But, to your dismay, your terminal prompt was no longer the neat little folder emoji it once was. Now, despite your best efforts, you were being forced once more to STARE at your own name every time you wanted to access the command line. Disgusting.
Anyways, if yOu ArE aNyThInG LiKe mE, and you want to remedy the situation, let me guide you through the exercise:
~
.cat .zshrc
.cd
to
/etc
and cat zshrc
.
# Default prompt
line followed by
PS1="%n@%m %1~ %# "
. As I'm sure you can gather, this PS1
needs to
be overriden in your ~/.zshrc
.
PS1
line with β+C
, and cd
back to
~
.
nano .zshrc
and paste in the PS1
line with β+V
, but don't
exit yet.%n@
" in the default prompt is the
culprit of the clutter-tastrophy in your current prompt. ^+O
to save the changes, and ^+X
to exit.And that's all there is to it! Happy tuning out the noise.
Thanks to https://www.makeuseof.com/customize-zsh-prompt-macos-terminal/ for pointing me towards the correct directories.