jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.15k stars 340 forks source link

Question about PROMPT_COMMAND variable #69

Closed devitalio closed 4 years ago

devitalio commented 4 years ago

Why in prompt.sh we need PROMPT_COMMAND="find_git_branch; find_git_dirty; $PROMPT_COMMAND"?

More specifically why we add the existing PROMPT_COMMAND making it grow?

devitalio commented 4 years ago

Found it, PROMPT_COMMAND is a bash var that sets what to execute before PROMPT is dispalyed. We save potentially already altered PROMPT_COMMAND https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html