3 ms·
I'm tried to minimise the length of "user@host fullpath" too. This is what I ended up with (in zsh): PS1='[%(?..%?)%(?.. ! )$PR_GREEN%2>>%n%<<@%m$PR_NO_COL
by viraptor 17y ago
I'm tried to minimise the length of "user@host fullpath" too. This is what I ended up with (in zsh):
PS1='[%(?..%?)%(?.. ! )$PR_GREEN%2>>%n%<<@%m$PR_NO_COLOR $PR_BLUE%30<...<%~%<<$PR_NO_COLOR]%(!.#.$) '
path is limited to 30 characters and the front is trimmed with '...'. There is a host, because I work on at least 5 at the same time every day, but the username is cut to only the first 2 letters (so it's either vi, or ro, or something else at uni). The return code is only visible when it's non-zero.