1

I'm using Arch Linux with Gnome 47 and Wayland and I want to use Midnight Commander's mcedit to edit text files in gnome-terminal.

mcedit by default uses the hotkeys Shift-Insert and Ctrl-Insert to paste and copy text. But this does not work because "something" is intercepting these hotkeys for copy/paste of the primary selection buffer. I don't know if this is handled by Gnome, Wayland or Linux itself.

I know I can choose other hotkeys for copy/paste in mcedit but I would prefer to keep these defaults and get them working instead, so I can SSH into other machines and use mcedit there without changing the mc configuration on every machine. So I want to fix the root problem instead of using workarounds.

How can I disable these global hotkeys in Gnome/Wayland/Linux? They are not defined in the hotkey preferences of gnome-terminal or gnome preferences, so I can't simply remove the binding. I can however add them as hotkeys in the gnome preferences and map them to some command, but that doesn't help me to get these keys appearing as normal keypresses in gnome-terminal so I can bind them in Midnight Commander.

The problem can also be reproduced without Midnight Commander by simply running cat in gnome-terminal:

  • Del, Shift-Del and Ctrl-Del generate the outputs ^[[3~, ^[[3;2~ and ^[[3;5~ as expected.
  • Insert generates the output ^[[2~ while Shift-Insert and Ctrl-Insert do nothing. What I would expect is that these keys output ^[[2;2~ and ^[[2;5~.
kayahr
  • 243

1 Answers1

2

Unfortunately these keybindings are hardcoded in GNOME Terminal (in fact in VTE, and therefore every VTE-based terminal emulator). If you're not against recompiling VTE and overwriting the one shipped by your distribution, you should remove these lines:

https://gitlab.gnome.org/GNOME/vte/-/blob/0.78.3/src/vte.cc?ref_type=tags#L5280-5294

and recompile VTE. Preferably use the version shipped by your distro, using the same compile flags and patches and whatnot, by following the steps your distro takes when creating the package. But you might of course choose to do it your way.

egmont
  • 2,566
  • 1
  • 15
  • 18