help-bash
[Top][All Lists]
Advanced

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

Re: Which character is used to reverse the direction in isearch.c?


From: Greg Wooledge
Subject: Re: Which character is used to reverse the direction in isearch.c?
Date: Thu, 23 Jan 2025 19:05:00 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri, Jan 24, 2025 at 02:59:34 +0530, Siddh Raman Pant wrote:
> I'm trying to see how Ctrl + Shift + R when in
> the reverse-i-search mode causes us to scroll
> down.

What kind of terminal are you even using?  On xterm and rxvt-unicode,
both Ctrl-R and Ctrl-Shift-R produce the same byte.  There is no way
bash can tell which one you pressed.

Here's how you can see what bytes your terminal is sending for each
key combo (this should work for *most* combos, including arrows and
function keys, but is not universal):

1) Type out this partial command:

    printf %s '

2) Press Ctrl-V (the "literal next" binding), and then your key combo.

3) Finish the command:

    ' | od -An -tx1

4) Press Enter.

As an example, it should look something like this:

hobbit:~$ printf %s '^R' | od -An -tx1
 12

If you get different results with Ctrl-R and Ctrl-Shift-R then you have
a highly unusual terminal.  Or maybe terminals are just built differently
in this crazy decade.



reply via email to

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