Created
May 7, 2026 20:59
-
-
Save geebru/76c8a0c1c61cd558bfd9ef076d646bfc to your computer and use it in GitHub Desktop.
Current bash prompt
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
| # --- Starship-style Prompt for Git Bash --- | |
| # --- Dependent on Maple Mono NF --- | |
| # Color Definitions | |
| CLR_USER='\[\e[38;5;216m\]' # Tan/Orange | |
| CLR_TEXT='\[\e[0m\]' # White/Reset | |
| CLR_PATH='\[\e[38;5;150m\]' # Soft Green | |
| CLR_GIT='\[\e[38;5;111m\]' # Soft Blue | |
| CLR_SYMBOL='\[\e[38;5;176m\]' # Soft Purple/Magenta | |
| CLR_RESET='\[\e[0m\]' | |
| # Icons | |
| GIT_ICON='' # Nerd Font Git Branch icon | |
| # Function to build Git segment | |
| function get_git_info() { | |
| if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then | |
| local branch=$(git branch --show-current) | |
| # Check for dirty status to add an asterisk | |
| local status=$(git status --porcelain 2>/dev/null) | |
| local dirty="" | |
| [[ -n $status ]] && dirty="*" | |
| echo -e " on ${CLR_GIT}${GIT_ICON} ${branch}${dirty}${CLR_RESET}" | |
| fi | |
| } | |
| # Main Prompt Function | |
| set_prompt() { | |
| # Grabbing the last command status for potential future use (like color change on error) | |
| local EXIT_CODE=$? | |
| # Format: user in path on branch | |
| # Line 1: user in path on branch | |
| # Line 2: > command | |
| PS1="\n${CLR_USER}\u ${CLR_TEXT}in ${CLR_PATH}\w$(get_git_info)${CLR_RESET}\n${CLR_SYMBOL}> ${CLR_RESET}" | |
| } | |
| PROMPT_COMMAND=set_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment