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


Groups > gnu.bash.bug > #14958

Re: readline fails to understand options.

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: readline fails to understand options.
Date 2018-12-26 12:02 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.6318.1545843787.1284.bug-bash@gnu.org> (permalink)
References <CAFra36jROcPExiFF=U+mAGHbASU8saKugDebHRbR_L8xHxSi-Q@mail.gmail.com>

Show all headers | View raw


On 12/21/18 12:52 AM, Bize Ma wrote:
> This works:
> 
>      $ bind 'set enable-bracketed-paste on'; bind -v | grep 'bracketed'
>      set enable-bracketed-paste on
> 
> However, almost any variation of the parameter "on" is not understood by
> readline:
> 
>      $ bind 'set enable-bracketed-paste on .'; bind -v | grep 'bracketed'
>      set enable-bracketed-paste off
> 
>      $ bind 'set enable-bracketed-paste "on"'; bind -v | grep 'bracketed'
>      set enable-bracketed-paste off
> 
> Without any error or warning !!

It strips trailing whitespace but not much else.

> It appears to fall to default value, while this:
> 
>      $ bind 'set bell-style on' ; bind -v | grep 'bell-style'
>      set bell-style audible
> 
>      $ bind 'set bell-style onf' ; bind -v | grep 'bell-style'
>      set bell-style audible
> 
> Stays at its last value.

The difference is that the readline parser treats anything other than "on"
or "1" as false/off/0 when it sets boolean variables.


> It seems that the parser for this options is unable to process anything
> after a valid parameter. And it doesn't emit an error or warning either.

Yes, the readline `bind' parser has traditionally been very permissive
in some ways, strict in others. There are more warnings than before, but
still relatively few.

> Since the parser needs some improvement: Could it be possible to add the
> capability to detect  a `#` after the options as a comment ?

Sure, it's a candidate for inclusion in a future version. I wouldn't object
if someone wanted to do a sample implementation, since it changes how the
variable value is parsed.

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

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


Thread

Re: readline fails to understand options. Chet Ramey <chet.ramey@case.edu> - 2018-12-26 12:02 -0500

csiph-web