VSCode on Mac Long Press Keys Not Repeating

Enable your key repeat in vscode on mac in the terminal


In some versions of vscode on Mac, when we long press a key, it does not repeat.


defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false


Apple has this ApplePressAndHold function, where we can long press a key to type alternative characters. This is very useful in many cases, e.g., typing öü on a English keyboard. This is enabled by default on Mac.

We can disable it for some certain applications to enable repeating. The above solution will disable it for vscode.

There are examples for other applications too. For example, to disable it for sublime, we can follow this gist: https://gist.github.com/leesmith/8029019

  1. jjcm jjcm. How do I press and hold a key and have it repeat in VSCode? In: Stack Overflow [Internet]. [cited 28 Mar 2022]. Available: https://stackoverflow.com/questions/39972335/how-do-i-press-and-hold-a-key-and-have-it-repeat-in-vscode  ↩︎

Planted: by ;

L Ma (2018). 'VSCode on Mac Long Press Keys Not Repeating', Datumorphism, 12 April. Available at: https://datumorphism.leima.is/til/misc/vscode/vscode-on-mac-do-not-repeat/.