Skip to content

fix(pty): pass display/desktop env vars to PTY to open browser on linux#1219

Merged
arnestrickmann merged 1 commit intogeneralaction:mainfrom
jschwxrz:emdash/fix-open-pr-terminal-7wy
Mar 2, 2026
Merged

fix(pty): pass display/desktop env vars to PTY to open browser on linux#1219
arnestrickmann merged 1 commit intogeneralaction:mainfrom
jschwxrz:emdash/fix-open-pr-terminal-7wy

Conversation

@jschwxrz
Copy link
Collaborator

@jschwxrz jschwxrz commented Mar 2, 2026

summary:

  • on linux, running gh pr view -w inside terminal fails because the PTY environment is missing display server variables

fix:

  • added DISPLAY_ENV_VARS and pass them to PTY spawn functions

limits:

  • could not reproduce on mac, linux specific issue

fixes #1147

@vercel
Copy link

vercel bot commented Mar 2, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

This PR fixes an issue where running commands like gh pr view -w inside Emdash terminals fail on Linux because the PTY environment lacks display server variables needed to open a browser. The fix introduces a comprehensive set of display/desktop environment variables and passes them through to all three PTY spawn functions (startPty(), startDirectPty(), and startSshPty()). The implementation properly handles both X11 and Wayland display servers, including XDG desktop environment variables and D-Bus session addresses required by modern Linux desktop portals.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-scoped, follow existing code patterns, and only add environment variable passthrough without modifying core logic. The implementation properly handles cross-platform compatibility (variables will be undefined on non-Linux systems), includes comprehensive comments, and applies the fix consistently across all PTY spawn functions.
  • No files require special attention

Important Files Changed

Filename Overview
src/main/services/ptyManager.ts Added comprehensive display server environment variables (X11, Wayland, XDG, D-Bus) to enable browser opening from PTY on Linux

Last reviewed commit: b04ee7c

@arnestrickmann arnestrickmann merged commit 0c93055 into generalaction:main Mar 2, 2026
3 of 4 checks passed
@jschwxrz jschwxrz deleted the emdash/fix-open-pr-terminal-7wy branch March 3, 2026 12:41
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.

[bug]: can't open PR in terminal via gh cli

2 participants