Search code examples
macosgithub-codespaces

Key repeat in GitHub Codespaces


In the text editor of a GitHub Codespace...

  • If I press-and-hold an arrow key on my keyboard, the key repeats. Perfect!
  • If I press-and-hold the j key, only one j is inserted. Not perfect!

How do I enable key repeat in the editor of a GitHub Codespaces for keys like j?

(If it makes a difference, I am using Google Chrome and MacOS.)


Solution

    1. In a macOS terminal, run one of the following:
    • Enable globally:
      defaults write -g ApplePressAndHoldEnabled 0

    • Enable only for Chrome:
      defaults delete -g ApplePressAndHoldEnabled
      defaults write "com.google.Chrome" ApplePressAndHoldEnabled 0

    1. Restart your browser.

    You may be curious why you are setting ApplePressAndHoldEnabled to false. It is because setting it to true enables the show character accents menu. For more detail, see this answer.

    HT: The IntelliJ IdeaVim plugin clued me into the existence of the ApplePressAndHoldEnabled setting.