Skip to content

fix(linux): convert StartupWMClass template values to lowercase - #327720

Open
TumnusVirus wants to merge 8 commits into
microsoft:mainfrom
TumnusVirus:fix-linux-wmclass
Open

fix(linux): convert StartupWMClass template values to lowercase#327720
TumnusVirus wants to merge 8 commits into
microsoft:mainfrom
TumnusVirus:fix-linux-wmclass

Conversation

@TumnusVirus

Copy link
Copy Markdown

Linux .deb installer creates duplicate desktop shortcuts leading to startup crash loops and orphaned crashpad handlers on Ubuntu MATE
#327088

When VS Code or VS Code Insiders compiles on Linux, it sets StartupWMClass using standard camel-case names, but the underlying runtime engine launches as low-case code or code-insiders, breaking taskbar icon-grouping window mappings on Linux panels like Ubuntu MATE.

Whenever a new version of code or code-insiders is downloaded for me, it opens up the URL handler desktop instead of the main desktop. With this change, it should no longer happen. I've gone into the code.desktop / code-insiders.desktop folder and updated it to code or code-insiders and it no longer exhibits that behaviour.

Copilot AI review requested due to automatic review settings July 27, 2026 21:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Linux packaging to align StartupWMClass with lowercase runtime identifiers.

Changes:

  • Transforms the desktop template value for DEB, RPM, and Snap packages.
  • Current transformation incorrectly produces triple hyphens for names such as Code - OSS.
Comments suppressed due to low confidence (2)

build/gulpfile.vscode.linux.ts:162

  • The RPM path has the same invalid derivation: Code - OSS becomes code---oss, which cannot match the code-oss runtime WM class. Use the existing product application name rather than converting the display name.
			.pipe(replace('@@NAME_SHORT@@', product.nameShort.toLowerCase().replace(/ /g, '-')))

build/gulpfile.vscode.linux.ts:249

  • The Snap desktop file will also get code---oss for the default product (and an analogous triple-hyphen Insiders value), so its StartupWMClass remains mismatched. Populate it from applicationName, which is already the runtime/package identifier.
			.pipe(replace('@@NAME_SHORT@@', product.nameShort.toLowerCase().replace(/ /g, '-')))

Comment thread build/gulpfile.vscode.linux.ts Outdated
@deepak1556 deepak1556 added this to the 1.132.0 milestone Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants