help-bash
[Top][All Lists]
Advanced

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

Re: readline questions


From: Christoph Anton Mitterer
Subject: Re: readline questions
Date: Mon, 04 Oct 2021 18:41:40 +0200
User-agent: Evolution 3.42.0-2

On Mon, 2021-10-04 at 11:13 -0500, Jesse Hathaway wrote:
> It appears that C-s and C-r are the only keybindings that are accepted
> in
> an incremental search, i.e. they are not configurable.

Actually I found this one (i.e. my question (1)) out myself.



The reason is rather that via the default of `isearch-terminators` (ESC
and Ctrl-J) *any* ESC, even if it's just meant to be part of some key
sequence, aborts the incremental search.

Unfortunately the system doesn't seem to understand that e.g.
"\e[5~"
isn't meant as ESC and something, but rather just PageUp.


When one sets:
set isearch-terminators "\C-j"
then key sequences like PageUp or so will work, but of course with the
side effect, that one cannot use ESC anymore to abort a incremental
search.



I think such things should really be part of the bash and readline
manpages.
I mean for gurus of the inner workings terminals/tty and keysequences
this may be obvious but the average user just thinks of PageUp being
completely unrelated to ESC.

Some of these oddities (like why Ctrl-S "doesn't work" and one could
use `stty  -ixon` to keep the tty from catching that) are rather easy
to find on the web.
But for others like this, one may search quite a while.

Similarly, there are many questions out there where people ask why they
cannot rebind Ctrl-W,... which can either be done with:
`set bind-tty-special-chars Off` (then readline doesn't bind Ctrl-W
fixed to the default)... or by `stty werase undef` which removes the
"special meaning to the terminal driver" altogether.

I didn't quite understand though, why `set bind-tty-special-chars Off`
frees up Ctrl-W, but doesn't Ctrl-S.


Anyway... would be nice to have that in the documentation, and if it's
just in an example section.



(2) seems less easy... I've asked for a new feature over at bug-
readline[0], whether the feature could use some custom field of
LS_COLORS... e.g. simply some special file extension like:
*.readline-colored-completion-prefix which no one else should ever use.
And also asked for some extension of that, which would allow to combine
the prefix colour with the colored-stats colour for the prefix..



Cheers,
Chris.

[0] https://lists.gnu.org/archive/html/bug-readline/2021-10/msg00000.html



reply via email to

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