Show me your prompt, /g/. Post the source, shell, and any other details.
Bash 4.3.export PROMPT_COMMAND=__prompt_command
function __prompt_command() {
local EXIT="$?"
local DEFAULT='\[\e[0m\]'
local RED='\[\e[0;31m\]'
local GREEN='\[\e[0;32m\]'
local DARK_GRAY='\[\e[0;90m\]'
local PURPLE='\[\e[0;35m\]'
local YELLOW='\[\e[0;33m\]'
PS1="\n${GREEN}\t${DEFAULT} "
if [ "$EXIT" != "0" ]; then
PS1+="${RED}$EXIT${DEFAULT} "
else
PS1+="$EXIT${DEFAULT} "
fi
JOBSCOUNT=$(jobs -p | wc -l)
if [ $JOBSCOUNT != "0" ]; then
PS1+="${YELLOW}$JOBSCOUNT${DEFAULT} "
fi
PS1+="${PURPLE}\w${DEFAULT}\n${DARK_GRAY}\u${DEFAULT}\\$ "
}
>>55500705
Also, colors are Base 16 Monokai: https://chriskempson.github.io/base16/#monokai
>>55500810
do you also wear a skirt?
zsh.~ λ echo $PS1
%{$fg[cyan]%}${PWD/#$HOME/~}%{$fg[magenta]%} λ %{$reset_color%}
>>55500705
>time in every single line
>>55500897
I just added time recently, along with the blank line.
I first added it at work, where it is nice to be able to look at my sessions from yesterday and see when I started jobs, etc. I kinda like it, but I'm not completely sold yet.
>>55500920
>>55500897
It's also useful as a "poor man's 'time'" on every command. I can go back and see how long something took to run, even if I didn't think to measure it the first time.
am i a tard?export PS1='[\u@\h \W]\$ '
maybe i ought to put the time in it and have colors but I don't want a super convoluted ps1
>not having it do \b every line
why even have a speaker
>>55500946
Nah, I used bare "$ " for a long time. Only add what you'll appreciate.
>>55500975
i mean, colors look super nice, and having the time would be useful for when you're not in X
doing it rn
can i have \A show the time in ISO 8601 (no separators)? muh tism demands it
>>55501024
you know you can use any variable you want in PS1?
>>55501024
>>55501094
You can also use PROMPT_COMMAND to build PS1 procedurally like I did in OP.