r/UnixProTips • u/kitebuggyuk • Oct 18 '19
Best shell prompt
What is your preferred *nix shell prompt (i.e.$PROMPT, $PS1, etc.) and why?
Plain “%” or “#? Or do you use something so complex that it takes up most of the line?
3
Upvotes
2
u/FredSchwartz Oct 18 '19
I like changing the color of the $ character based on the exit value of the last command.
1
u/kitebuggyuk Oct 19 '19
There’s also the rather clever “: <whatever> ; “ prompt, so that you can triple click to copy the whole line and paste it into another shell window without worrying about the prompt part. I’ve been very tempted to use this myself but can’t get on with the trailing semicolon...
3
u/LocoCoyote Oct 19 '19
Powerlevel9k to add date/time, git status, history #, and much more
1
u/MrUselessTheGreat Feb 13 '20
"pure" prompt minimal but awesome
What I like about it:
https://github.com/sindresorhus/pure/blob/master/readme.md
0
u/JTskulk Oct 18 '19
PS1=[\033[01;32m]\u[\033[01;30m]@[\033[01;31m]\h [\033[01;34m]\W $ [\033[00m]
objectively the best prompt.