git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 0/3] enable color prompt in non-pcmode

From
Eduardo R. D'Avila <erdavila@gmail.com>
Date
Jun 16, 2013, 17:32 UTC
Message-ID
<cover.1371402672.git.erdavila@gmail.com>

The use of colors in a prompt is only possible in pcmode (using the variable PROMPT_COMMAND).

Make color prompt work in non-pcmode (using the variable PS1) for both Bash and ZSH.

This requires editing __git_ps1() and __git_ps1_colorize_gitstring(), which have duplicate code to handle the prompt gitstring and color codes.

Prior to enable colors in non-pcmode, refactor __git_ps1() and __git_ps1_colorize_gitstring().

Eduardo R. D'Avila (3):
  t9903: add tests for git-prompt pcmode
  git-prompt.sh: refactor colored prompt code
  git-prompt.sh: enable color prompt in non-pcmode
 contrib/completion/git-prompt.sh |  91 +++++--------
 t/t9903-bash-prompt.sh           | 269 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 301 insertions(+), 59 deletions(-)
-- 
1.8.3.1.440.g82707f8
Next: Eduardo R. D'Avila
Message 1 of 9 in “enable color prompt in non-pcmode”
  1. 0/3 enable color prompt in non-pcmodeEduardo R. D'Avila, Jun 16, 2013
  2. 1/3 t9903: add tests for git-prompt pcmodeEduardo R. D'Avila, Jun 16, 2013
  3. Junio C HamanoJun 17, 2013
  4. 1/3 t9903: add tests for git-prompt pcmodeEduardo R. D'Avila, Jun 18, 2013
  5. 2/3 git-prompt.sh: refactor colored prompt codeEduardo R. D'Avila, Jun 18, 2013
  6. 3/3 git-prompt.sh: enable color prompt in non-pcmodeEduardo R. D'Avila, Jun 18, 2013
  7. 3/3 git-prompt.sh: enable color prompt in non-pcmodeEduardo R. D'Avila, Jun 18, 2013
  8. 2/3 git-prompt.sh: refactor colored prompt codeEduardo R. D'Avila, Jun 16, 2013
  9. 3/3 git-prompt.sh: enable color prompt in non-pcmodeEduardo R. D'Avila, Jun 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.