microsoft / microsoft/vscode

Subprocess environment breaks GDK apps that do not support Wayland

Open
#332,230 2 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

When the integrated terminal or other subprocess invokes a command that launches a GDK application which does not directly support Wayland, it will exit with an error being unable to open the display.

e.g. from the integrated terminal, launch `emacs` (tested w/ 27.2)

```shell
$ echo $GDK_BACKEND
wayland
$ emacs

(emacs:82187): Gtk-WARNING **: 14:11:15.788: cannot open display: :0
$
```

I have narrowed this down to the `GDK_BACKEND=wayland` environment variable being set; with no fallback.

```shell
$ export GDK_BACKEND=wayland,x11
$ emacs; echo "exited with $?"; emacs --version
exited with 0
GNU Emacs 27.2
Copyright (C) 2021 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
$
```

This variable is not set elsewhere in my system or user environment.

Please consider resolving by one of:
* resetting this variable post-launch to the host/user value, or un-setting it if none.
* if overriding it in subprocesses, append `,x11` to allow the launched processes to negotiate the appropriate display driver.

VS Code version: Code 1.130.0 (1b6a188127eeaf9194f945eb6eb89a657e93c54c, 2026-07-22T14:55:04Z)
OS version: Linux x64 6.1.166-1.el9.elrepo.x86_64
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 4300)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x1fbb, DRIVER_VENDOR=Mesa, DRIVER_VERSION=25.2.7
GPU1: VENDOR= 0x8086, DEVICE=0x9a49, DRIVER_VENDOR=Mesa, DRIVER_VERSION=25.2.7 *ACTIVE*
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgpu: enabled
webgpu_on_vk_via_gl_interop: enabled
webnn: disabled_off|
|Load (avg)|1, 1, 0|
|Memory (System)|30.80GB (16.51GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|gnome|
|XDG_CURRENT_DESKTOP|GNOME|
|XDG_SESSION_DESKTOP|gnome|
|XDG_SESSION_TYPE|wayland|

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.