Repository navigation
fix: only default to headed under the VS Code debugger when a display is available - #328
Merged
Pavel Feldman (pavelfeldman) merged 2 commits intoOct 8, 2026
Merged
Conversation
… is available When pytest is launched from the VS Code Python extension with the debugger attached, the browser was always launched headed. On Linux machines without a display server (remote SSH, WSL2, containers) this fails. Check for DISPLAY / WAYLAND_DISPLAY on Linux before defaulting to headed. Fixes #122
Pavel Feldman (pavelfeldman)
added this pull request to stack #335
October 7, 2026 23:05
Yury Semikhatsky (yury-s)
approved these changes
Oct 8, 2026
… Wayland and --headed precedence
Pavel Feldman (pavelfeldman)
deleted the
fix-122-headed-without-display
branch
October 8, 2026 01:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When pytest is launched from the VS Code Python extension with the debugger attached, the browser was always launched headed. On Linux machines without a display server (remote SSH, WSL2, containers) that launch fails, even though
--headedwas never passed.Headed is now only the default under the debugger when a display is configured: always on macOS and Windows, elsewhere when
DISPLAYorWAYLAND_DISPLAYis set. This checks the environment, not that the display server is reachable;--headedstill forces headed mode either way.Tests simulate the VS Code launcher with an attached debugger: X11, Wayland, no display, and
--headedwithout a display (sync + async).Fixes #122
Stack created with GitHub Stacks CLI • Give Feedback 💬