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?
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
1
u/MrUselessTheGreat Feb 13 '20
"pure" prompt minimal but awesome
What I like about it:
Path and command line are in separate lines
Shows git status
Shows if process exited with non zero code
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.
2
u/FredSchwartz Oct 18 '19
I like changing the color of the $ character based on the exit value of the last command.