From e6ff4dda5091887e3728e2ec9ae872d61c92b270 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 26 Jan 2020 18:18:11 +0000 Subject: [PATCH] Fix graphical `brew edit` behaviour - Without `DISPLAY` as an envvar in `bin/brew`, running `brew edit` with $EDITOR set to a graphical editor (eg `gedit`), it errored on Linux: ``` $ EDITOR=gedit brew edit vim Editing /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb Unable to init server: Could not connect: Connection refused (org.gnome.gedit:15470): Gtk-WARNING **: 18:17:07.537: cannot open display: Error: Failure while executing; `gedit /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb` exited with 1. ``` Fixes #6958. --- bin/brew | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/brew b/bin/brew index 5831791a75..5206997402 100755 --- a/bin/brew +++ b/bin/brew @@ -88,7 +88,7 @@ then FILTERED_ENV=() # Filter all but the specific variables. - for VAR in HOME SHELL PATH TERM TERMINFO COLUMNS LOGNAME USER CI SSH_AUTH_SOCK SUDO_ASKPASS \ + for VAR in HOME SHELL PATH TERM TERMINFO COLUMNS DISPLAY LOGNAME USER CI SSH_AUTH_SOCK SUDO_ASKPASS \ http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY \ "${!HOMEBREW_@}" "${!TRAVIS_@}" do