Michael Vorburger.ch Blog

Visual Studio Code 'launch-failed' code '159' Crash Fixed

December 29, 2024
Visual Studio Code 'launch-failed' code '159' Crash Fixed image

Visual Studio Code ’launch-failed’ code ‘159’ Crash Fixed

Recently my Visual Studio Code on Fedora Linux 41 Workstation failed to start, saying: “The window terminated unexpectedly (reason ’launch-failed’ code ‘159’)”.

I initially attempted to solve this by starting it with code --verbose --wait, but that just showed some error messages which didn’t mean all that much to me.

Google Gemini was kind enough to walk me through debugging this using the following steps:

  1. Try code --user-data-dir /tmp/vscode-test … that worked (for me) - so the “binary” was probably fine (e.g. no need to reinstall the package), but some “config” was “bad”…

  2. Try code --disable-extensions … that didn’t help (for me) - so it’s not something extensions related - phew, VSC arch is sound!

  3. Try code --disable-gpu … that didn’t help (for me) - so it’s nothing related to my cool AMD GPU - good!

  4. Try code --ozone-platform=x11 to see if it’s Wayland related - nope!

At this point, I lost patience… given that a fresh ~/.config/Code data directory seemed to “fix it”, mv ~/.config/Code/ ~/.config/Code.BAD seemed the most effective way to resolve this.

I knew that I could easily “start over” because I keep all of my global VSC Keybindings, Personal Code Snippts & Settings under version control, and have scripts to export and easily re-install my VSC extensions!

It became more interesting when it still happened! Using Spock’s 🖖 Vulcan Deduction Logic, I figured that something somewhere in this specific version of my VSC settings.json clearly, and reproducibly, caused this.

Taking a (not quite so…) random wild guess, I narrowed it down to being caused by "workbench.productIconTheme": "adwaita"! I added that, years ago, based on this guide, but it looks like some recent Fedora Upgrade broke this somehow. Removing that fixed it!

PS: Filed VSC bug #237058 just in case VSC maintainers wanted to further debug this.