bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] beta2 bugs in dump-variables and *-mode-string


From: Steve Jones
Subject: Re: [Bug-readline] beta2 bugs in dump-variables and *-mode-string
Date: Wed, 27 Jul 2016 19:34:31 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, 27 Jul 2016, Chet Ramey wrote:

> On 7/27/16 10:30 AM, Steve Jones wrote:
> > I've just started testing the new readline/bash and found two issues.
> > 
> > dump-variables() always shows the default variables for
> > vim-*-mode-string or the emacs-mode-string.  here is a fix for that one.
> 
> Thanks for the report and fix.
> 
> 
> > The other is that if non-printing characters are used in the
> > *-mode-strings then the strings starts leaking into the line.  This
> > happens with both vi and emacs mode.  Also the show-mode string is not
> > updated correctly when switching between modes.  my strings are:
> > 
> > set emacs-mode-string "\1\e[1;address@hidden "
> > set vi-ins-mode-string "\1\e[1;32m\2+\1\e[0m\2 "
> > set vi-cmd-mode-string "\1\e[1;31m\2-\1\e[0m\2 "
> 
> I can't reproduce this in bash, even with a PS1 that contains non-printing
> characters.  Can you explain how you are reproducing this?

I use a 3 line prompt but that is not part of the problem.  I also use
yafc ftp client with readline and it shows the same with a short one
line prompt.  I rebuilt yafc just to test this.

I normally use vi mode.  When switching between command and insert or
back the above mode strings do not update the indicator until the prompt
hast to be redrawn as with a '2dw' or a <C>-L.  When the prompt is
redrawn if the string is longer than the last line of the prompt, mine
is '$ ' then the non displaying characters after the ones that are
supposed to display leak into the line.  Typing over them with any
character removes them, as does scrolling through the history.  This
also happens when switching between emacs mode and vim mode with a bound
key sequence.

If the inset mode line looks like this:
+ $ _
when I first swithc to command mode it still looks like
+ $ _

For example i have:
+ $ This is a long command_

and I change to command mode it looks like 
+ $ T1m- is a long command

after 2b:
- $ Tim- is a long command

command cc:
- $ T2m+ $ _

Any mode change with such a shout prompt causes the problem.  If the
total length of the displaying prompt is 8 cells then there is no
problem.  Mode changes update like they should and every thing works.
It only happens with a prompt that is shorter than where the second mode
character shows up in the above example.

- $ T2m+ $ _
       ^
       | bad

+ yafc> _
Good

-- 
Steve Jones
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]