Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12013

Re: [PATCH] Support configurable mode strings in prompt

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: [PATCH] Support configurable mode strings in prompt
Date 2015-12-14 16:23 -0500
Message-ID <mailman.2104.1450128243.31583.bug-bash@gnu.org> (permalink)
References (2 earlier) <mailman.8246.1409835641.1147.bug-bash@gnu.org> <dc8903d2-ab21-4945-9e8b-67944652058f@googlegroups.com> <CAM1XmN_7=9bBeyV7ptwi6DqdioSpBkOtvUuDtuHpvD8mPfcR7Q@mail.gmail.com> <54696200.8080905@case.edu> <CAM1XmN_8aAp8=Q1L=rJHACmi7Q64hNu-dKkz3SrXBQUTvxgGcg@mail.gmail.com>

Show all headers | View raw


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/

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: [PATCH] Support configurable mode strings in prompt Chet Ramey <chet.ramey@case.edu> - 2015-12-14 16:23 -0500

csiph-web