I want to use the last exit code to customize my bash prompt. So following this question I should add $?
inside a function:
PROMPT_COMMAND=__prompt_command
__prompt_command() {
local EXIT="$?"
...
I tried many times, but whenever I add a function on my C:\Program Files\Git\etc\profile.d\git-prompt.sh
file, Git Bash can't run this file, and it doesn't use it.
Is there a way to use a function on git-prompt.sh
on Git Bash for Windows, or another approach to use the last exit code to customize the bash prompt?