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: Rob Foehl
Subject: Re: [Bug-readline] vi-{cmd, ins}-mode-string and show-mode-in-prompt
Date: Sat, 9 Dec 2017 15:37:36 -0500 (EST)

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.

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.

This turned out to be a fairly minor change; see attached patch against current devel branch from git. I believe this covers all cases correctly, including emacs-mode-string, and without causing any backward compatibility issues since the show-mode-in-prompt behavior is unchanged if set. Would you consider applying this?

-Rob

Attachment: readline-mode-strings.patch
Description: Text document


reply via email to

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