Re: Add colors to the prompt for status indicators
- From
Kevin Ballard <kevin@sb.org>
- Date
- Nov 16, 2010, 09:07 UTC
- Message-ID
- <C43669C9-CD42-4D51-BFB9-567AAA422C06@sb.org>
- In-Reply-To
- <AANLkTimpyug867ccsKA+fLjzDJ8NukQXcPnVJw3Uk4LD@mail.gmail.com>
On Nov 16, 2010, at 12:11 AM, Sebastien Douche wrote:
Show 25 quoted lines
> On Tue, Nov 16, 2010 at 00:14, Kevin Ballard <kevin@sb.org> wrote: >> I take it back. We can use PROMPT_COMMAND for this, to set up variables >> containing what you want. >> >> Something like the following should work: > > Hi Kevin, > good job! I looked the git prompt and I'm a bit disappointed with the > combination, ps1 can show many items: > > # > % > + > * > $ > REBASE-i| > REBASE-m| > MERGING| > BISECTING| > < > <> (or u+count u-count u+countu-count) > > Each item is "optional", so you can have REBASE-i| with * and +, or > only *. It seems to complicated to wrap all items (I think of the > verbose mode for upstream branches). Maybe coding a lua (or Python) > prompt with a config file.
In the end you need to stuff everything that needs a distinct color into its own shell variable. You could just extend the shell function that's doing that right now, or you could write a script in another language that emits a shell-quoted set of variables suitable for evaling by the shell.
-Kevin Ballard