-1

I use Linux Mint with 'Terminal GNOME'.

I want to use CTRL+C in terminal to copy text. Easy.. I set it in Preferences, but I also need to send somehow 'intr' signal to apps.

I want to make terminal send 'intr' signal when I click CTRL+B, not CTRL+C. Easy.. I made changes in tty settings with:

stty intr ^B

and everything was fine.

Then I found that when I open 'screen' started by someone who uses CTRL+C, I cannot send 'intr' signal. It ignores my CTRL+B and CTRL+C is blocked by Terminal 'copy' function. I work on servers with other users and I cannot tell them to change their tty config.

Is there any option to 'wire' my CTRL+B 'click' in Terminal to CTRL+C click (but not copy), so underlaying tty will see CTRL+C and my Terminal will copy text when I click CTRL+C on keyboard?

I can use other terminal app, compile it, whatever.


I read many tutorials/questions on stack and did not find answer. Also downloaded few popular terminal applications for Linux Mint, but none had option to 'reconfigure' signal shortcuts.

  • 1
    You're sharing accounts? How do you know who does what? – Kusalananda Aug 24 '18 at 9:28
  • try to use shift+insert to copy to terminal – Yves Aug 24 '18 at 9:45
  • @Kusalananda I administrate other people servers. Some apps need to be run with root privileges and on some server they run on 'screen' on 'root' user. – JerzySBG Aug 24 '18 at 10:11
  • @Yves Right now I use CTRL+B to copy 'from' Terminal and CTRL+V to copy 'to' Terminal, but I would like to make it work as in every other app - with CTRL+C. – JerzySBG Aug 24 '18 at 10:13
-1

Certain terminal emulators allow you to redefine what sequences the keys send (e.g. Konsole under its profile preferences, I'm pretty sure XTerm can also do so in its X resources file); GNOME Terminal and its underlying VTE terminal emulation widget is not one of these, they have hardcoded keys.

If you don't mind recompiling and replacing the VTE library (preferably using the same version as your distro ships with the same compile options, patches, etc. – it's probably called vte2.91, around version 0.48 – 0.52 or so), you can easily patch in this feature. Add this to src/keymap.cc next to the similar definitions:

static const struct _vte_keymap_entry _vte_keymap_GDK_b[] = {
        {cursor_all, keypad_all, GDK_CONTROL_MASK, "\x03", -1},
        {cursor_all, keypad_all, 0, X_NULL, 0},
};

and this to _vte_keymap[]:

        {GDK_KEY_b,                     _vte_keymap_GDK_b},
  • Checked 'Konsole'. On local machine CTRL+B to send INT signal is fine. In case of SSH connection, it closes whole connection to remote machine (sends INT to 'ssh' ran on local machine). – JerzySBG Aug 30 '18 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.