summaryrefslogtreecommitdiff
path: root/builtin/commit-graph.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2023-02-28 08:59:34 -0600
committerJunio C Hamano <gitster@pobox.com>2023-03-16 15:58:22 -0700
commit7ee1af8cb8b97385fc4e603bc024d877def5adb4 (patch)
tree4ab6c0ee06ad2b74f870d4d8eb42aba379da886e /builtin/commit-graph.c
parent73876f4861cd3d187a4682290ab75c9dccadbc56 (diff)
completion: prompt: use generic colors
When the prompt command mode was introduced in 1bfc51ac81 (Allow __git_ps1 to be used in PROMPT_COMMAND, 2012-10-10), the assumption was that it was necessary in order to properly add colors to PS1 in bash, but this wasn't true. It's true that the \[ \] markers add the information needed to properly calculate the width of the prompt, and they have to be added directly to PS1, a function returning them doesn't work. But that is because bash coverts the \[ \] markers in PS1 to \001 \002, which is what readline ultimately needs in order to calculate the width. We don't need bash to do this conversion, we can use \001 \002 ourselves, and then the prompt command mode is not necessary to display colors. This is what functions returning colors are supposed to do [1]. [1] http://mywiki.wooledge.org/BashFAQ/053 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Tested-by: Joakim Petersen <joak-pet@online.no> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
0 files changed, 0 insertions, 0 deletions