Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Ctrl/Shift + insert to copy/paste on windows and linux #107

Merged

Conversation

runarberg
Copy link
Contributor

Many systems (including MS Windows and many linuxes) map Ctrl + Insert to copy and Shift + Insert to paste. That serves as a handy fallback when the more common Ctrl + C and Ctrl + V keybindings have their default prevented to send signals to the terminal.

Currently all keydown-events with the insert key send \x1b[2~ to the terminal. Instead this PR won’t send anything if either the shiftKey or the ctrlKey are present in the event. Also it will enable contentEditable when shiftKey is present to allow for pasting in Firefox and Edge.

Many systems (including MS Windows and many linuxes) map `<Ctrl>` +
`<Insert>` to copy and `<Shift> + <Insert>` to paste. That serves as a
handy fallback when the more common `<Ctrl> + C` and `<Ctrl> + V`
keybindings have their default prevented to send signals to the
terminal.

Currently all keydown-events with the insert key send `\x1b[2~` to the
terminal. This commit won't send that key if either the `shiftKey` or
the `ctrlKey` are present. Instead it will enable `contentEditable` to
allow for pasting.
@runarberg runarberg force-pushed the fix/ctrl-or-shift-insert-copy-pasting branch from 74b1a50 to 524db02 Compare June 9, 2016 13:45
@Tyriar
Copy link
Member

Tyriar commented Jun 10, 2016

Ideally this should be configurable, I'd like VS Code users to be able to use their preferred method (the default of which will probably be ctrl|cmd+shift+c/v). gnome-terminal has a settings dialog which allows customizing of a bunch of keybindings that aren't native

image

Perhaps allowing consumers to do more generic mappings would be a good idea?

Also shift+insert at least on gnome-terminal appears to be a shortcut for middle-click to paste selection, not from clipboard.

@parisk
Copy link
Contributor

parisk commented Jun 10, 2016

While I agree with @Tyriar that some kind of customization/extensibility considering key bindings, I do not believe that this is blocking at the moment.

This PR works 👍 . LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants