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

Keyboard shortcut for copy of line doesn't work on Linux #6197

Closed
mirao opened this issue May 8, 2016 · 8 comments

Comments

Projects
None yet
7 participants
@mirao
Copy link

commented May 8, 2016

  • VSCode Version: 1.0.0
  • OS Version: Ubuntu 16.04 LTS

Steps to Reproduce:

  1. Click into a text line
  2. Press Ctrl + Shift + Alt + UpArrow or Ctrl + Shift + Alt + DownArrow

Expected result:

  • line is duplicated up/down

Actual result:

  • nothing happens

Workaround:

  • run the command from the command palette
@alexandrudima

This comment has been minimized.

Copy link
Member

commented May 9, 2016

@mirao You can also rebind them in File > Preferences > Keyboard Shortcuts. E.g.:

{ "key": "shift+alt+down",        "command": "editor.action.copyLinesDownAction",
                                     "when": "editorTextFocus" },
{ "key": "shift+alt+up",          "command": "editor.action.copyLinesUpAction",
                                     "when": "editorTextFocus" },
@martynovskyi

This comment has been minimized.

Copy link

commented Jan 16, 2017

VSCode Version: 1.8.1
Has same problem.

@alexandrudima

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

There are a number of reasons why certain keybindings would not reach VS Code. e.g.: the OS binds OS functionality to them, other installed sofware "captures and steals" them, etc.

It is your responsibility to manage your system and identify what sofware / OS setting causes this behaviour. If we don't receive a keybinding, there is nothing we can do about it.

To find out if a keybinding arrives in VS Code:

  1. Open Preferences > Keyboard Shortcuts
  2. Click on Define Keybinding
  3. Press your desired key combination
    (e.g. doing it for Ctrl+Shift+1):
    image
  4. If the key combination does not reflect what you press or shows "unknown", it means VS Code is not receiving these key down events.

Rebinding a command to a different keybinding

  1. Identify the keybinding you would like to rebind (e.g:)
{ "key": "ctrl+shift+1",          "command": "editor.action.replaceOne",
                                     "when": "editorFocus && findWidgetVisible" },
  1. Copy paste it to your keybindings.json with a different "key" that does make its way to VS Code:
{ "key": "ctrl+shift+2",          "command": "editor.action.replaceOne",
                                     "when": "editorFocus && findWidgetVisible" },
@mirao

This comment has been minimized.

Copy link
Author

commented Jan 21, 2017

@alexandrudima : Yes, that's the case on my Ubuntu, I get "unknown" for arrow in such combination (Ctrl + Shift + Alt + unknown).
Is the reported combination working on some Linux distro ? Because if not, it shouldn't be offered as a default on Linux.

I can confirm that the remapped combination shift+alt+down and shift+alt+down works well and I have been using it for long time in VScode on Win/Linux.

@alexandrudima

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

@mirao It is difficult to find default keybindings that work across all distributions. But that is why all our keybindings are configurable.

If you would like to help, you can look into creating a good PR for #509 or create a keymap extension that targets a specific distribution (e.g. of a keymap extension https://github.com/Microsoft/vscode-sublime-keybindings).

@roblourens roblourens removed the bug label Jan 25, 2017

@roblourens

This comment has been minimized.

Copy link
Member

commented Jan 25, 2017

Removing 'bug' label as it doesn't look like we made a change for this?

@SrdjanMilic

This comment has been minimized.

Copy link

commented Aug 20, 2017

Shift+ctrl+alt+(up, down, left, right) are reserved shortcuts on Ubuntu for moving windows to different workspaces. Disabling those will enable default vscode shortcuts to work as expected.

@BhavikCpatel

This comment has been minimized.

Copy link

commented Nov 11, 2017

I changed it mine in ubuntu as shown below

C + A + S + - instead of C + S+ A+ Down Arrow
C + A+ S + = instead of C + S + A + Up Arrow

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.