git/contrib/completion
Avi Halachmi (:avih) fbcdfab348 git-prompt: support custom 0-width PS1 markers
When using colors, the shell needs to identify 0-width substrings
in PS1 - such as color escape sequences - when calculating the
on-screen width of the prompt.

Until now, we used the form %F{<color>} in zsh - which it knows is
0-width, or otherwise use standard SGR esc sequences wrapped between
byte values 1 and 2 (SOH, STX) as 0-width start/end markers, which
bash/readline identify as such.

But now that more shells are supported, the standard SGR sequences
typically work, but the SOH/STX markers might not be identified.

This commit adds support for vars GIT_PS1_COLOR_{PRE,POST} which
set custom 0-width markers or disable the markers.

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-20 08:28:19 -07:00
..
.gitattributes completion: mark bash script as LF-only 2017-05-10 13:32:51 +09:00
git-completion.bash completion: adapt git-config(1) to complete subcommands 2024-05-17 09:26:19 -07:00
git-completion.tcsh completion: tcsh: Fix regression by drop of wrapper functions 2021-08-18 13:58:27 -07:00
git-completion.zsh completion: zsh: stop leaking local cache variable 2024-04-30 15:24:56 -07:00
git-prompt.sh git-prompt: support custom 0-width PS1 markers 2024-08-20 08:28:19 -07:00