From abcb1a1aa10edf3bcf5cd792c93f809aea456dfd Mon Sep 17 00:00:00 2001 From: David Refoua Date: Tue, 15 Jul 2025 19:26:49 +0330 Subject: [PATCH 1/3] display MSYSTEM if set; fix indentation; add comment --- vendor/git-prompt.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/git-prompt.sh b/vendor/git-prompt.sh index a02af62..f25784f 100644 --- a/vendor/git-prompt.sh +++ b/vendor/git-prompt.sh @@ -20,7 +20,7 @@ function getSimpleGitBranch() { then echo " (${headContent:16})" else - echo " (HEAD detached at ${headContent:0:7})" + echo " (HEAD detached at ${headContent:0:7})" fi } @@ -38,12 +38,12 @@ then . ~/.config/git/git-prompt.sh fi else - PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title - # PS1="$PS1"'\n' # new line + # Taken from https://github.com/git-for-windows/build-extra/blob/main/git-extra/git-prompt.sh + PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]' # set window title + # PS1="$PS1"'\n' # new line (disabled) PS1="$PS1"'\[\033[32m\]' # change to green PS1="$PS1"'\u@\h ' # user@host - # PS1="$PS1"'\[\033[35m\]' # change to purple - # PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set) PS1="$PS1"'\[\033[33m\]' # change to brownish yellow PS1="$PS1"'\w' # current working directory if test -z "$WINELOADERNOEXEC" @@ -68,7 +68,7 @@ else fi PS1="$PS1"'\[\033[0m\]' # change color PS1="$PS1"'\n' # new line - PS1="$PS1"'λ ' # prompt: always λ + PS1="$PS1"'λ ' # prompt: Cmder uses λ fi MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc \ No newline at end of file From cb768684116a9ce9081c76f86671610ddafd15e8 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Tue, 15 Jul 2025 19:29:16 +0330 Subject: [PATCH 2/3] Import from upstream git-prompt.sh: user-specific bash completion scripts Source: https://github.com/git-for-windows/build-extra/commit/061dbfe92b3a5c93aa0c284c8dad979f7e7c0935 --- vendor/git-prompt.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vendor/git-prompt.sh b/vendor/git-prompt.sh index f25784f..630073b 100644 --- a/vendor/git-prompt.sh +++ b/vendor/git-prompt.sh @@ -71,4 +71,15 @@ else PS1="$PS1"'λ ' # prompt: Cmder uses λ fi -MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc \ No newline at end of file +MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc + +# Evaluate all user-specific Bash completion scripts (if any) +if test -z "$WINELOADERNOEXEC" +then + for c in "$HOME"/bash_completion.d/*.bash + do + # Handle absence of any scripts (or the folder) gracefully + test ! -f "$c" || + . "$c" + done +fi \ No newline at end of file From aff4ad259fb158c8b35683f0d5d7c5c7a82d1451 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Tue, 15 Jul 2025 20:25:59 +0330 Subject: [PATCH 3/3] fix color values and names mismatch in comments --- vendor/cmder_prompt_config.lua.default | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/cmder_prompt_config.lua.default b/vendor/cmder_prompt_config.lua.default index 0c99bd8..d6c0a8c 100644 --- a/vendor/cmder_prompt_config.lua.default +++ b/vendor/cmder_prompt_config.lua.default @@ -48,15 +48,15 @@ prompt_overrideSvnStatusOptIn = false -- Colors: https://github.com/cmderdev/cmder/wiki/Customization#list-of-colors -- Effects: https://github.com/cmderdev/cmder/wiki/Customization#list-of-effects -- --- Green: "\x1b[1;33;49m" --- Yellow: "\x1b[1;32;49m" +-- Green: "\x1b[1;32;49m" +-- Yellow: "\x1b[1;33;49m" -- Light Grey: "\x1b[1;30;49m" -- Prompt Element Colors -uah_color = "\x1b[1;33;49m" -- Green = uah = [user]@[hostname] -cwd_color = "\x1b[1;32;49m" -- Yellow cwd = Current Working Directory +uah_color = "\x1b[1;33;49m" -- Yellow uah = [user]@[hostname] +cwd_color = "\x1b[1;32;49m" -- Green cwd = Current Working Directory lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color clean_color = "\x1b[37;1m" dirty_color = "\x1b[33;3m" -- Yellow, Italic conflict_color = "\x1b[31;1m" -- Red, Bold -unknown_color = "\x1b[37;1m" -- White = No VCS Status Branch Color +unknown_color = "\x1b[37;1m" -- White, Bold = No VCS Status Branch Color