Skip to content

Instantly share code, notes, and snippets.

@refactor
Created August 18, 2023 09:59
Show Gist options
  • Save refactor/8a1aaef9769845e6d74953acae619cd2 to your computer and use it in GitHub Desktop.
Save refactor/8a1aaef9769845e6d74953acae619cd2 to your computer and use it in GitHub Desktop.

Revisions

  1. refactor created this gist Aug 18, 2023.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    PS1="\$(\
    EXIT=\"\$?\" ; \
    RED=\"\[\e[31m\]\" ; \
    WHITE=\"\[\e[0m\]\" ; "
    PS1+="\
    endchar=\"\\$\${WHITE}\" ; \
    if [ \"\$EXIT\" -eq 0 ]; then \
    endchar=\"\${WHITE}\$endchar\" ; \
    else \
    endchar=\"\${RED}[\$(errno \${EXIT})] \$endchar\";\
    fi ; "
    PS1+="echo \"${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$endchar \" )"