diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2024-08-20 01:48:32 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-20 08:28:19 -0700 |
commit | fbcdfab34852329929e6bfdd2bac8e49f2e3d8e3 (patch) | |
tree | a9d8150f9d39b70ee4129d4ee96753c0992894e2 /builtin/commit.c | |
parent | 0dbe3d3f1610742f118237f2ad8a9e91bb3cdd39 (diff) |
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>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions