[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Support configurable mode strings in prompt
From: |
Chet Ramey |
Subject: |
Re: [PATCH] Support configurable mode strings in prompt |
Date: |
Mon, 14 Dec 2015 16:23:54 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
On 12/6/15 10:34 PM, Dylan Cali wrote:
>
> On Sun, Nov 16, 2014 at 9:48 PM, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>> wrote:
>
> Most of this will be in the next release of bash. I added some things and
> left out the \m prompt expansion for now.
>
>
> Hi Chet,
>
> I finally had a chance to play with the 4.4 beta. Unfortunately, it seems
> to be getting confused when color escapes are used (getting a lot of
> garbage when I switch to command mode). These are the mode strings I used
> (just the defaults with green/yellow color escapes):
>
> set vi-ins-mode-string \1\e[32;1m\2(ins)\1\e[0m\2
> set vi-cmd-mode-string \1\e[33;1m\2(cmd)\1\e[0m\2
Thanks for the report. The problem involved redrawing only the changed
portion of the prompt string (which is what readline's redisplay does by
default). When the first differing character appears in a portion of the
prompt that is bracketed by non-printable characters, you have to redraw
the entire prompt to make sure that all the escape sequences are output.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/