4

The kitty terminal emulator uses the shortcut Ctrl + Shift + R for window resizing. The shortcut is also used by bash for reversing the reverse-i-search direction.

First I tried to to remove the kitty shortcut by mapping it to no_op using

map ctrl+shift+r no_op

But then Ctrl + Shift + R inserts 4;6u instead of the shortcut being passed to the shell like it does in other terminals.

As second option I tried mapping the shortcut to discard_event using

map ctrl+shift+r discard_event

But then Ctrl + Shift + R behaves like no key was pressed at all.

Testcase:

  • Press Ctrl + R
  • Enter a term that appears multiple times in your bash history
  • Press Ctrl + R again to get to the next match
  • Press Ctrl + Shift + R to get to the previous match (this step fails in kitty)

2 Answers 2

1

The actual way to unmap a shortcut is to set the key map to no_op. For example:

map ctrl+shift+r no_op

discard_event stops the event from propagating period, so the running program never receives it.

-1

To unmap the keyboard shortcut defined by Kitty, try instead :

map ctrl+shift+r discard_event

2
  • 1
    The key is still not passed (correctly) to the shell. Testcase: press ctrl-r to reverse-i-search for a word. press ctrl-r again to get to the next match. Then press ctrl-shift-r to get to the previous one. With no_op you get 4;6u inserted into the terminal and with discard_event nothing happens at all.
    – allo
    Sep 20, 2022 at 10:29
  • Yep, this doesn't seem to forward the keypress to the terminal, it just actually discards it, which makes it useless
    – Hubro
    Dec 1, 2022 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .