By default on Linux/Windows, alacritty does not bind the Control+Insert keyboard shortcut to Copy (or CopySelection), but does bind Shift+Insert to Paste. This lacks symmetry and breaks the workflow of users who use the standard Control/Shift+Insert for copy/paste. These shortcuts are particularly useful in the context of terminals because they are the same across most other Windows/Linux apps and provide a way to avoid the disaster of accidentally pressing Control+C in the terminal via muscle memory.

The request here is simple: Add Control+Insert with a default binding to the Copy action.

Note that I tried binding this action to CopySelection, but was unable to get it working to my satisfaction on Linux, so am suggesting just binding this to Copy.

Specific suggested changes:

  1. In fn common_keybindings() in bindings.rs, add this line:
    bindings!(
    ...
        Insert,   ModifiersState::CTRL, ~BindingMode::VI; Action::Copy;
    ...)
  1. Add this default to the key_bindings section of alacritty.yml:
key_bindings:
  ...
   # (Windows, Linux, and BSD only)
   # - { key: Insert,         mods: Control,                         action: Copy             }

Thanks for consideration of this feature request!

System

  • OS: Linux/BSD/Windows (Not MacOS)
  • Version: alacritty 0.10.1 ()
  • Linux/BSD: X11, i3wm with compton
0

Control + Insert to copy makes exactly zero sense to me. Which other applications on Linux have this binding enabled by default?

0

Control+Insert has a long history between both Linux and Windows, and it also has support among many Linux applications.

See this excellent article describing the history: https://www.howtogeek.com/804030/the-origins-of-ctrlc-ctrlv-ctrlx-and-ctrlz-explained/

When Windows 1.0 was first introduced in 1985, it used Control+Insert for Copy, and it wasn't until Windows 3.1 (in 1992) when it also supported Ctrl+C for Copy (based on the Apple Lisa and Later Macintosh line). Linux came out around that same time and most of the Linux-based UIs copied many aspects from Windows, including the shortcuts for cut/copy/paste and undo.

In terms of Control+Insert now, I believe that most major applications still offer support. I know Chrome supports it (and think Firefox does too, but haven't used that in years now). More importantly, other major terminals support it, like gnome-terminal and Terminator.

Admittedly, I am finding it difficult to find good documentation for support of Control+Insert, but it's typically worked for me in Linux. Try it out on a few apps.

Also, note that the related shortcut of Shift+Insert is already bound to Paste by default, so it would make sense to add in the corresponding binding for Copy for symmetry.

0

Try it out on a few apps.

I don't have an insert key.

Also, note that the related shortcut of Shift+Insert is already bound to Paste by default, so it would make sense to add in the corresponding binding for Copy for symmetry.

Having Shift+Insert bound to paste makes some sense at least, considering the key is called "insert". And it's not just a normal paste, it is a PasteSelection binding.

I'd probably want to test XTerm/Urxvt/Kitty at least to see how terminal emulators generally support this. But since I don't have an insert key I'm not going to write this patch anyway. If you're interested and you've tested that all the mentioned terminals support this too, then I'd be happy to accept a PR.

0

Thanks Christian!

I'm happy to provide a PR for this and was just confirming it would be accepted before starting. I'm targeting this weekend.

1

(As mentioned in the linked PR, I'm currently running into issues with the change, so have the PR still in draft)

0
© 2022 pullanswer.com - All rights reserved.