Windows launched from VSCode appear as VSCode in Ubuntu dock and with Alt+TAB

Viewed 212

When I launch a graphical application from VSCode's terminal, the newly launched application appears as a new VSCode window in Ubuntu's dock and when using Alt+TAB to switch between windows/applications. For example, when I launch evince from VSCode, I don't see the evince icon in the dock, but GNOME groups the evince window and the VSCode window under the VSCode application in the dock).

What mechanism is used to attach windows created by separate applications to the VSCode window? Is there a way to disable it (i.e. let the VSCode terminal behave like usual terminals when launching GUI applications)?

2 Answers

This happens when VSCode is installed through the snap package. Indeed, snap is not only a package manager but a kind of container technology, hence the snap version of the VSCode process is ran within a container, and child processes are also containerized.

Solution : install VSCode through another system. For Ubuntu, there's a .deb package on VSCode's download page, which doesn't have the issue.

That does not happen for me, but I'd guess it might be setting or overwriting the WM_CLASS: https://askubuntu.com/a/1060233.

Under X11 windows have XWindowAttributes structure and XClassHint structures properties from which applications get information about windows. Specifically the last one is responsible for the WM_CLASS property, two comma-separated strings, which can be seen easily via xprop command.
...
For instance, this also can be useful property for something like docks that group windows under the same icon of an application.

Sadly I'm not aware of any solutions to the problem, at least not any that are easier or better than just running the programs some other way...

Related