Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: brew edit don't work with graphical editor #6958

Closed
3 tasks done
OpenA opened this issue Jan 25, 2020 · 1 comment · Fixed by #6995
Closed
3 tasks done

Linux: brew edit don't work with graphical editor #6958

OpenA opened this issue Jan 25, 2020 · 1 comment · Fixed by #6995
Labels
outdated PR was locked due to age

Comments

@OpenA
Copy link

OpenA commented Jan 25, 2020

Please note 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.

  • 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)

Im tryng to open formulae in GUI editor with brew edit command

What happened (include command output)

if i try set EDITOR variable with any graphical aditor

EDITOR=xed brew edit boost

it does not open anything and return error

Command output
Editing /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb
Unable to init server: Could not connect: Connection refused

(xed:5521): Gtk-WARNING **: 13:54:44.674: cannot open display:
Error: Failure while executing; xed /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/boost.rb exited with 1.

What you expected to happen

if i add DISPLAY to the enveroinment variables list, located in bin/brew script:

  FILTERED_ENV=()
  # Filter all but the specific variables.
  for VAR in HOME SHELL DISPLAY PATH TERM TERMINFO COLUMNS 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_@}"

it is solve the problem

Output of brew config and brew doctor commands

HOMEBREW_VERSION: 2.2.4-2-g23108f3
ORIGIN: https://github.com/Homebrew/brew
HEAD: 23108f3c736030070ca1e4673652c20c503a7d02
Last commit: 4 days ago
Core tap ORIGIN: https://github.com/Homebrew/linuxbrew-core
Core tap HEAD: 3acb179b5f46d100eec3e6aeafa5160eba5240fd
Core tap last commit: 21 hours ago
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CACHE: /home/arrte/.cache/Homebrew
HOMEBREW_LOGS: /home/arrte/.cache/Homebrew/Logs
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_VISUAL: /usr/bin/xed
CPU: quad-core 64-bit penryn
Homebrew Ruby: 2.6.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/bin/ruby
Clang: N/A
Git: 2.25.0 => /home/linuxbrew/.linuxbrew/bin/git
Curl: 7.58.0 => /usr/bin/curl
Kernel: Linux 5.3.0-26-generic x86_64 GNU/Linux
OS: Linux Mint 19.3 Tricia (tricia)
Host glibc: 2.27
/usr/bin/gcc: 7.4.0
glibc: N/A
gcc: 5.5.0_7
xorg: 20170115_1

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  mesa
@MikeMcQuaid
Copy link
Member

if i add DISPLAY to the enveroinment variables list, located in bin/brew script:

Please submit a PR for this, thanks!

issyl0 added a commit to issyl0/brew that referenced this issue Feb 3, 2020
- 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 Homebrew#6958.
@lock lock bot added the outdated PR was locked due to age label Mar 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants