bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] vi-{cmd, ins}-mode-string and show-mode-in-prompt


From: Chet Ramey
Subject: Re: [Bug-readline] vi-{cmd, ins}-mode-string and show-mode-in-prompt
Date: Sat, 9 Dec 2017 17:54:33 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/9/17 3:37 PM, Rob Foehl wrote:
> On Thu, 7 Dec 2017, Chet Ramey wrote:
> 
>> On 12/6/17 11:46 PM, Rob Foehl wrote:
>>> Any chance these could be made to work as documented, removing the
>>> dependency on show-mode-in-prompt?
>>
>> The `dependency' on show-mode-in-prompt is intentional: the strings aren't
>> prefixed to the displayed prompt string unless that variable is enabled.
>> That has been the case even when the strings weren't user-settable (e.g.,
>> bash-4.3). If the documentation doesn't make that clear, then I need to
>> clarify it.
> 
> Right, but that's the issue here: in bash-4.3, for example, trying to use
> an inputrc which sets the various mode strings and show-mode-in-prompt just
> results in the prompt being mangled by the fixed strings included in that
> release, and the custom strings ignored.  Since there's no way to test the
> application version in readline conditionals, this means the inputrc isn't
> portable to older releases -- a problem with shared home directories and
> the like.

So the problem is simply that you don't like the default strings in
bash-4.3?

If this is a serious problem, move the setting of the variable into the
bash startup files, where you can run the appropriate `bind' command
based on the values of $BASH_VERSION and $BASH_VERSINFO.

> If, on the other hand, the mode string variables were used unconditionally
> after being set, and without show-mode-in-prompt set, then there is no
> issue with older releases -- and this is how they're currently documented
> to work in readline-7.0 / bash-4.4, even if that wasn't intentional.

Not exactly.  The documentation is garbled, but it's simply wrong to
assume that the behavior of show-mode-in-prompt being a toggle to turn
the behavior on and off would have changed between bash-4.3 and bash-4.4
without me noting the change in the change log. The documentation is
obviously in error, but the desired behavior is that show-mode-in-prompt
toggle the display of the mode characters (4.3) or mode strings (4.4).

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

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