You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
ran brew update and can still reproduce the problem?
ran brew doctor, fixed all issues and can still reproduce the problem?
ran brew config and brew doctor and included their output with your issue?
What you were trying to do (and why)
Any brew command that passes a URL to open a tab in the web browser fails on Linux. For example, brew home or brew info --github.
What happened (include command output)
The correct web browser command runs, but fails with an error that the display cannot be opened and the tab is not opened.
Command output
mike@host:~$ brew home
(google-chrome:32228): Gtk-WARNING **: 20:57:36.156: cannot open display:
mike@host:~$ brew info --github gcc
(google-chrome:32447): Gtk-WARNING **: 20:57:40.127: cannot open display:
What you expected to happen
The web browser should open a new tab with the given URL.
The reason is clearly that the DISPLAY environment variable is removed in the sanitized environment that brew runs itself in. If I locally modify brew to include DISPLAY in the list of whitelisted environment variables, then the web page is opened as expected.
Suggestion for the fix: rather than whitelisting DISPLAY instead this should be one of the variables copied to i.e. HOMEBREW_DISPLAY and then assigned back to DISPLAY in the relevant commands e.g. home, info, search.
@mtmiller Thanks for the bug report, Mike. Are you interested in taking a shot at fixing this yourself and submitting a PR? Here's the relevant line of code:
@sjackman Thanks, yeah I am happy to take a look at this. I liked the suggestion to copy DISPLAY to HOMEBREW_DISPLAY and restore it when needed, so I will try that. I'll be snowed in this weekend, so I expect I'll have some time to look at this.
Great. Thanks, Mike! Feel free to ask here if you have any questions, or open a PR if you have a work-in-progress but have questions about your implementation.
Please note that we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew
command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's abrew cask
problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
Any
brew
command that passes a URL to open a tab in the web browser fails on Linux. For example,brew home
orbrew info --github
.What happened (include command output)
The correct web browser command runs, but fails with an error that the display cannot be opened and the tab is not opened.
Command output
What you expected to happen
The web browser should open a new tab with the given URL.
The reason is clearly that the
DISPLAY
environment variable is removed in the sanitized environment thatbrew
runs itself in. If I locally modifybrew
to includeDISPLAY
in the list of whitelisted environment variables, then the web page is opened as expected.Step-by-step reproduction instructions (by running
brew
commands)Output of
brew config
andbrew doctor
The text was updated successfully, but these errors were encountered: