r/ProgrammerTIL • u/shrike_lazarus • Jun 06 '22
Other (Shell) TIL that you can also format the shell prompt
The shell has always felt cluttered and hard to parse for me, and today I stumbled onto the fact that you can (in zsh at least) format the prompt however you like!
With whitespace and some icons, I think it's way easier to read now, and it's easy to scroll back up through the history and find a particular entry
Here's a tutorial I used to learn how it worked
62
Upvotes
22
u/UghImRegistered Jun 06 '22
Adding the current git branch to your prompt is one of those things you can't live without once you know you can do it.
20
u/sje46 Jun 06 '22
Yeah you can do all sorts of cool things with shells (and terminals in general). It might be worth it to dive into ansi escape codes.
Check out /r/unixporn. Mostly linux and not mac people, but people post their dotfiles and you can copy and paste what they have into your own.
13
u/ivolimmen Jun 07 '22
Check out oh-my-zsh!
4
u/wooshock Jun 07 '22
Not sure what OS it is, but you can make the shell prompt semi transparent. I can never get over how cool that looks
2
u/ENSJAM Jun 08 '22
https://starship.rs
1
u/MLNotW Jun 07 '22
If you are already using zsh try out this amazing theme: https://github.com/romkatv/powerlevel10k
It super easy to setup and customize. It even provides a wizard where you can step through and see how the different options would look like.
I use it for my daily driver in conjunction with oh-my-zsh though you can use it standalone.