Merge pull request #5706 from mtmiller/display-env

Set DISPLAY environment variable for browser on Linux
This commit is contained in:
Mike McQuaid 2019-02-13 09:44:56 +00:00 committed by GitHub
commit 20e9f10d5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 1 deletions

View File

@ -162,6 +162,12 @@ Note that environment variables must have a value set to be detected. For exampl
If set, Homebrew will tweak behaviour to be more relevant for Homebrew
developers (active or budding), e.g. turning warnings into errors.
* `HOMEBREW_DISPLAY`:
If set, Homebrew will use this X11 display when opening a page in a browser,
for example with `brew home`. Primarily useful on Linux.
*Default:* the value of the user's `DISPLAY` environment variable.
* `HOMEBREW_EDITOR`:
If set, Homebrew will use this editor when editing a single formula, or
several formulae in the same directory.

View File

@ -388,6 +388,8 @@ def exec_browser(*args)
browser ||= OS::PATH_OPEN if defined?(OS::PATH_OPEN)
return unless browser
ENV["DISPLAY"] = ENV["HOMEBREW_DISPLAY"]
safe_exec(browser, *args)
end

View File

@ -54,7 +54,7 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
# Whitelist and copy to HOMEBREW_* all variables previously mentioned in
# manpage or used elsewhere by Homebrew.
for VAR in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY BINTRAY_USER BINTRAY_KEY \
BROWSER EDITOR GIT NO_COLOR PATH VISUAL
BROWSER DISPLAY EDITOR GIT NO_COLOR PATH VISUAL
do
# Skip if variable value is empty.
[[ -z "${!VAR}" ]] && continue

View File

@ -1037,6 +1037,12 @@ Note that environment variables must have a value set to be detected. For exampl
If set, Homebrew will tweak behaviour to be more relevant for Homebrew
developers (active or budding), e.g. turning warnings into errors.
* `HOMEBREW_DISPLAY`:
If set, Homebrew will use this X11 display when opening a page in a browser,
for example with `brew home`. Primarily useful on Linux.
*Default:* the value of the user's `DISPLAY` environment variable.
* `HOMEBREW_EDITOR`:
If set, Homebrew will use this editor when editing a single formula, or
several formulae in the same directory.

View File

@ -1266,6 +1266,13 @@ If set, any commands that can emit debugging information will do so\.
If set, Homebrew will tweak behaviour to be more relevant for Homebrew developers (active or budding), e\.g\. turning warnings into errors\.
.
.TP
\fBHOMEBREW_DISPLAY\fR
If set, Homebrew will use this X11 display when opening a page in a browser, for example with \fBbrew home\fR\. Primarily useful on Linux\.
.
.IP
\fIDefault:\fR the value of the user\'s \fBDISPLAY\fR environment variable\.
.
.TP
\fBHOMEBREW_EDITOR\fR
If set, Homebrew will use this editor when editing a single formula, or several formulae in the same directory\.
.