Last active
July 2, 2025 19:34
-
-
Save nerdCopter/50c7ff1ef13846085c1dfab404657846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.ps1-prompt | |
# Color definitions (all original) | |
DULL=0 | |
BRIGHT=1 | |
FG_BLACK=30 | |
FG_RED=31 | |
FG_GREEN=32 | |
FG_YELLOW=33 | |
FG_BLUE=34 | |
FG_VIOLET=35 | |
FG_CYAN=36 | |
FG_WHITE=37 | |
FG_NULL=00 | |
BG_BLACK=40 | |
BG_RED=41 | |
BG_GREEN=42 | |
BG_YELLOW=43 | |
BG_BLUE=44 | |
BG_VIOLET=45 | |
BG_CYAN=46 | |
BG_WHITE=47 | |
BG_NULL=00 | |
ESC="\033" | |
NORMAL="\[\033[m\]" | |
RESET="\[\033[${DULL};${FG_WHITE};${BG_NULL}m\]" | |
# Dull text | |
BLACK="\[\033[${DULL};${FG_BLACK}m\]" | |
RED="\[\033[${DULL};${FG_RED}m\]" | |
GREEN="\[\033[${DULL};${FG_GREEN}m\]" | |
YELLOW="\[\033[${DULL};${FG_YELLOW}m\]" | |
BLUE="\[\033[${DULL};${FG_BLUE}m\]" | |
VIOLET="\[\033[${DULL};${FG_VIOLET}m\]" | |
CYAN="\[\033[${DULL};${FG_CYAN}m\]" | |
WHITE="\[\033[${DULL};${FG_WHITE}m\]" | |
# Bright text | |
BRIGHT_BLACK="\[\033[${BRIGHT};${FG_BLACK}m\]" | |
BRIGHT_RED="\[\033[${BRIGHT};${FG_RED}m\]" | |
BRIGHT_GREEN="\[\033[${BRIGHT};${FG_GREEN}m\]" | |
BRIGHT_YELLOW="\[\033[${BRIGHT};${FG_YELLOW}m\]" | |
BRIGHT_BLUE="\[\033[${BRIGHT};${FG_BLUE}m\]" | |
BRIGHT_VIOLET="\[\033[${BRIGHT};${FG_VIOLET}m\]" | |
BRIGHT_CYAN="\[\033[${BRIGHT};${FG_CYAN}m\]" | |
BRIGHT_WHITE="\[\033[${BRIGHT};${FG_WHITE}m\]" | |
# Reverse text examples (if you want to use them) | |
REV_CYAN="\[\033[${DULL};${BG_WHITE};${BG_CYAN}m\]" | |
REV_RED="\[\033[${DULL};${FG_YELLOW};${BG_RED}m\]" | |
# Capture last exit status in ERR | |
PROMPT_COMMAND='export ERR=$?' | |
# Set PS1: symbol first (with space after ✓), then path, then prompt | |
#PROMPT_COMMAND="$PROMPT_COMMAND; PS1=\"\$(prompt_symbol)${BRIGHT_CYAN}\w/${RESET} \$ \"" | |
#PS1="\$(prompt_symbol)${BRIGHT_CYAN}\w/${RESET} \$ " | |
PS1="${BRIGHT_GREEN}\$( [[ \$ERR -eq 0 ]] && echo ' ✓ ' || echo \"${BRIGHT_RED}✗=\$ERR${BRIGHT_GREEN} \")${BRIGHT_CYAN}\w/${RESET} \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment