Fixing slow Visual Studio Code on a Raspberry Pi 4

I never thought I’d be running Visual Studio Code on a Raspberry Pi. But now you can. The Raspberry Pi 4 is just about powerful enough to make it useable. Normally I’d be using remote Visual Studio Code from my PC, but for some environments - in this case using the Raspberry Pi PICO in-circuit debugger - you have to work on the Pi itself.

I tried this and was surprised just how horrible it was. Keystrokes were talking seconds to register. It turns out that there is a fix for this. You need to turn of hardware acceleration in Visual Studio Code. Open it up, use CTRL+SHIFT+P to open the command window and type: Preferences: Configure Runtime Arguments

This opens up a configuration file which contains a property called disable-hardware-acceleration which is normally commented out. Remove the comments so that the line “lights up” as below. Then quit Visual Studio and restart it. And you should find the user interface properly useable.

I’m connecting to the Pi on my PC via a VNC connection. It might be that working this way interferes with the way that graphics are rendered too, but it is easy to reverse if you find it makes things worse.