Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

The Copy Line Down shortcut does nothing in VS Code on Linux

ErrorCopy Line Down does nothing when the key combination is pressed

Short answer

A shortcut does nothing when something else gets the keys first or when another entry for the same keys wins. Use VS Code's keyboard troubleshooting log to see whether the keys arrive, then Show Same Keybindings for conflicts. The command is editor.action.copyLinesDownAction, which you can rebind.

  • Applies to VS Code 1.10x, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Turn on key logging and press the shortcut in the editor. The Output panel shows which key VS Code received and which command ran.

    Command Palette -> Developer: Toggle Keyboard Shortcuts Troubleshooting
  2. 2Match what you see, then jump to its fix

    1. 1The troubleshooting log shows nothing when you press the combinationThe operating system or another program takes the keysFix
    2. 2The log shows the key arriving, but a different command runsAnother entry uses the same keys, or a user rule overrides itFix
    3. 3The shortcut works in an editor but not in another panel such as a terminal or the search boxThe when clause is false where you are typingFix

What does the error look like?

  • Copy Line Down does nothing when the key combination is pressed
  • A new key combination in the Keyboard Shortcuts editor does not take effect

Cause 1 of 3

The operating system or another program takes the keys

1Check

A combination the OS or another application already uses may never reach VS Code. The VS Code docs also warn that a graphics driver such as NVIDIA's may override some default shortcuts.

Press the keys in another text editor; if that also does nothing, the desktop or driver is consuming them.

2Fix

Free that combination in the desktop's keyboard settings, or bind Copy Line Down to a different combination in the Keyboard Shortcuts editor.

// keybindings.json
[
  { "key": "ctrl+alt+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" }
]

3Verify

Press the new combination in an open file.

The current line is duplicated below the cursor.

Confirmed by code.visualstudio.com

Did this fix it?

Cause 2 of 3

Another entry uses the same keys, or a user rule overrides it

1Check

In the Keyboard Shortcuts editor, right-click the entry and choose Show Same Keybindings; use Show User Keybindings to see only your own rules.

Command Palette -> Preferences: Open Keyboard Shortcuts

2Fix

Change or remove the conflicting entry in the Keyboard Shortcuts editor, or give Copy Line Down another combination.

// keybindings.json: give Copy Line Down keys that Show Same Keybindings reports as unused
[
  { "key": "ctrl+alt+j", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" }
]

3Verify

Show Same Keybindings now lists only one command for the keys.

Right-click the entry again and choose Show Same Keybindings.

Confirmed by code.visualstudio.com

Did this fix it?

Cause 3 of 3

The when clause is false where you are typing

1Check

A binding runs only when its when clause is true. Read the clause in the Keyboard Shortcuts editor or in the default keybindings JSON.

Command Palette -> Preferences: Open Default Keyboard Shortcuts (JSON)

2Fix

Click into the file you are editing first, or edit the entry's when clause to cover the place you press it.

{ "key": "ctrl+alt+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus" }

3Verify

Press the shortcut with the cursor in the editor.

The line is copied.

Confirmed by code.visualstudio.com

Did this fix it?

How do I stop it coming back?

  • Check Show User Keybindings now and then so old custom rules do not pile up.
  • Pick custom shortcuts that Show Same Keybindings reports as unused.
  • Keep keybindings.json in your synced settings so every machine behaves the same.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.