Fixing VS Code GitHub auth on KDE: 'OS keyring is not available for encryption. Ensure you have kwallet running'

TL;DR

code --password-store="gnome-libsecret"

The problem

Even with kwallet installed and running, Visual Studio Code will show the error prompt "OS keyring is not available for encryption. Ensure you have kwallet running" after trying to sign in to GitHub.

The fix

VS Code can use any keyring that implements the Secret Service API (including kwallet5) by passing the (not very well named) CLI flag --password-store=gnome-libsecret:

code --password-store=gnome-libsecret

Despite its name, you don’t need to install gnome-libsecret to use this flag.

And from the VS Code docs:

you can persist the value of password-store by opening the Command Palette (Ctrl+Shift+P) and running the Preferences: Configure Runtime Arguments command. This will open the argv.json file where you can add the setting "password-store":"gnome-libsecret"