fix: respect existing DISPLAY instead of always spawning Xvfb#4893
Open
chdlc wants to merge 1 commit into
Open
fix: respect existing DISPLAY instead of always spawning Xvfb#4893chdlc wants to merge 1 commit into
chdlc wants to merge 1 commit into
Conversation
On Linux the server always starts a fresh Xvfb even when DISPLAY is already set (WSLg, X11 forwarding, etc). This puts the browser on the virtual display instead of the user real screen. Now we check DISPLAY first — if it is there, use it. If not, Xvfb as before. Signed-off-by: Christian de la Cruz <chrisdlc119@outlook.com>
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.
Problem
On Linux the server always spawns a new Xvfb virtual display, even when
DISPLAYis already set (WSLg, X11 forwarding, desktop environments). This forces the browser onto the invisible virtual display instead of the user's real screen.Fix
Check
process.env.DISPLAYbefore creating Xvfb. If set, reuse it directly. If not set, fall back to Xvfb as before.No new env vars, no config changes. Fully backward compatible.
Testing
DISPLAYset (WSLg): browser launches on real screen, logsusing existing displayDISPLAY(Docker, CI): Xvfb created as before, no behavior change