Skip to content

Fixing VSCode on Wayland

Published: at 12:17 PM

the problem.

NVIDIA and Wayland don’t always get along, although it’s slowly getting better. Electron apps in general are a bit laggy on Wayland and sometimes redraw old frames. This is usually not a big deal but in the case of apps where you type a lot, like VS Code, it is absolutely game-breaking as you end up not knowing if you missed a letter, trying to fix phantom typos, etc.

i normally use Neovim or IntelliJ for my coding setup, but VS Code’s live preview extensions are very nice for web development in particular, so i needed a fix.

my solution.

Similarly to other electron apps i tried forcing VS Code to use native Wayland with the following in ~/.config/code-flags.conf (VSCode’s version of electron-flags.conf):

 --enable-features=UseOzonePlatform --ozone-platform=wayland

This immediately crashed the program after booting. Looking at the logs it seemed to be a problem with the way Hyprland draws the window decorations?

Thanks to @KorigamiK it can be fixed by forcing VS Code to draw the title bar (which is normally hidden in linux) by adding to ~/.config/Code/User/settings.json the line:

  "window.titleBarStyle": "custom",

Now i can actually see what i type!