Set DISPLAY environment variable for browser on Linux

Fixes #5692
This commit is contained in:
Mike Miller 2019-02-10 23:30:54 -08:00
parent 7ce517cb2d
commit ae1e4e7022
2 changed files with 5 additions and 1 deletions

View File

@ -388,6 +388,10 @@ def exec_browser(*args)
browser ||= OS::PATH_OPEN if defined?(OS::PATH_OPEN)
return unless browser
if ENV["HOMEBREW_DISPLAY"]
ENV["DISPLAY"] = ENV["HOMEBREW_DISPLAY"]
end
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