Skip to content

Instantly share code, notes, and snippets.

@wischi-chr
Last active September 3, 2025 16:20
Show Gist options
  • Save wischi-chr/dc76a8990033ee2c28c9905bd988b7a7 to your computer and use it in GitHub Desktop.
Save wischi-chr/dc76a8990033ee2c28c9905bd988b7a7 to your computer and use it in GitHub Desktop.
Pin keyboard layout for code-server/vscode

This a workaround to address coder/code-server#4694 and microsoft/vscode#135960

  1. Open the keyboard selection menu by pressing the layout button in the bottom right corner

  2. Select "Configure Keyboard Layout"

    This opens keyboardLayout.json with the following default content:

    // Defines the keyboard layout used in VS Code in the browser environment.
    // Open VS Code and run "Developer: Inspect Key Mappings (JSON)" from Command Palette.
    
    // Once you have the keyboard layout info, please paste it below.
  3. Open the keyboard layout selection menu again and make sure the layout you want is selected (de in my case)

    Double check that the layout was changed in the bottom right corner:

    If it doesn't work on the first try (that's another bug), try switching between different layouts until it works.

  4. Open the Command Palette (Ctrl + P on my system) and search key mappings and select the "(JSON)" variant.

  5. Double check the JSON that was generated in a new file matches the layout you want:

  6. Copy everything

  7. Paste into keyboardLayout.json (I left the comment as is) and save.

  8. Reload the page an test if it worked.

  9. The custom layout should now be automatically selected and also show up in the keyboard layout selection menu:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment