Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lira/67ef6fe087993785571648b5f8d4bfc7 to your computer and use it in GitHub Desktop.
Save lira/67ef6fe087993785571648b5f8d4bfc7 to your computer and use it in GitHub Desktop.
Remove "MINGW" text from Git Bash prompt and window title

Remove "MINGW" text from Git Bash prompt and window title

Quickly remove the text without having to create a custom prompt.

Edit the file: C:\Program Files\Git\etc\profile.d\git-prompt.sh

 else
        TITLEPREFIX=$MSYSTEM
 fi
 
 if test -f ~/.config/git/git-prompt.sh
 then
        . ~/.config/git/git-prompt.sh
 else
-       PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
+       PS1='\[\033]0;$PWD\007\]' # set window title
        PS1="$PS1"'\n'                 # new line
        PS1="$PS1"'\[\033[32m\]'       # change to green
        PS1="$PS1"'\u@\h '             # user@host<space>
-       PS1="$PS1"'\[\033[35m\]'       # change to purple
-       PS1="$PS1"'$MSYSTEM '          # show MSYSTEM
        PS1="$PS1"'\[\033[33m\]'       # change to brownish yellow
        PS1="$PS1"'\w'                 # current working directory
        if test -z "$WINELOADERNOEXEC"
        then
                GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
                COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
                COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
                COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"

Note: After an update the file will be overwritten, so you will need to apply the changes again.

Tested on: Git for Windows 2.15.1.windows.2

Reference: How To Customize The Git For Windows Bash Shell Prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment