help-bash
[Top][All Lists]
Advanced

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

Re: readline questions


From: Chet Ramey
Subject: Re: readline questions
Date: Fri, 8 Oct 2021 12:18:36 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.2

On 10/2/21 7:29 PM, Christoph Anton Mitterer wrote:
Hey.

Perhaps someone can help out with these:

1) Since most terminals catch ^S for XOFF, and I didn't want to change
or rebind that,... I tried to rebind the keys for:
reverse-search-history
forward-search-history

PageUp/PageDown seem unused in the shell.

So I did something like the followin in ~/.inputrc:
$if Bash
"\e[5~": forward-search-history
"\e[6~": reverse-search-history
$endif

That works for going into forward/reverse search mode, but I can only
find the first result.
If I press another PageUp/Down, as I'd have pressed another Ctrl-R/S to
move on, nothing happens.


btw: Is there any preferred way: bind command or ~/.inputrc?

This is as you discovered: if ESC is part of the set of characters that
terminates an incremental search, it will terminate the search. Readline
doesn't attempt to read far enough ahead to determine whether or not
the escape sequence resolves to a key binding for reverse-search-history
or, say, backward-char.

2) I wanted to change the colour used by colored-completion-prefix or
maybe just have it use dim colours so that it works more nicely with
colored-stats.

Now I found out that colored-completion-prefix uses the so colour of
LS_COLORS, but ideally I wouldn't want to change the colour sockets.

When I change the LS_COLORS at runtime, it doesn't seem to be picked up
anymore. Only when it's already exported from where I start the shell.

Readline only looks at the value of LS_COLORS when it first initializes,
not on every call. It treats those colors as session-persistent.

Should I move it to the initialization that's done on each call to
readline()?

--
``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/



reply via email to

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