Changes __git_ps1 to allow its use as PROMPT_COMMAND in bash
in addition to setting PS1 with __git_ps1 in a command substitution.
PROMPT_COMMAND has advantages for using color without running
into prompt-wrapping issues. Only by assigning \[ and \] to PS1
directly can bash know that these and the
Apologies if you receive this e-mail multiple times, my MTA was misconfigured...
Changes __git_ps1 to allow its use as PROMPT_COMMAND in bash
in addition to setting PS1 with __git_ps1 in a command substitution.
PROMPT_COMMAND has advantages for using color without running
into prompt-wrapping
Simon Oosthoek s.oosth...@xs4all.nl writes:
__git_ps1 ()
{
+ local pcmode=no
+ #defaults/examples:
+ local ps1pc_start='\u@\h:\w '
+ local ps1pc_end='\$ '
+ local printf_format='(%s)'
+ ...
This conversion is wrong, given that ...
@@ -284,6 +317,12 @@ __git_ps1 ()
Simon Oosthoek s.oosth...@xs4all.nl writes:
changes __git_ps1 to not just allow use in setting PS1
with __git_ps1 in a command substitution, but also allows
__git_ps1 to be used as PROMPT_COMMAND in bash.
This has advantages for using color and I think it is more
elegant
Is and I think
Hi Junio
thanks for your feedback!
On 08/10/12 20:12, Junio C Hamano wrote:
Simon Oosthoek s.oosth...@xs4all.nl writes:
changes __git_ps1 to not just allow use in setting PS1
with __git_ps1 in a command substitution, but also allows
__git_ps1 to be used as PROMPT_COMMAND in bash.
This has
Simon Oosthoek s.oosth...@xs4all.nl writes:
How about This has advantages for using color without running
into prompt-wrapping issues. Only by assigning \[ and \] to PS1
directly can bash know these and the color codes in between don't
count in the length of the prompt.?
I'll rewrite the
changes __git_ps1 to not just allow use in setting PS1
with __git_ps1 in a command substitution, but also allows
__git_ps1 to be used as PROMPT_COMMAND in bash.
This has advantages for using color and I think it is more
elegant
Signed-off-by: Simon Oosthoek soosth...@nieuwland.nl
---
7 matches
Mail list logo