Skip to content

Fix: Neovide.app not working in Finder #1242

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

Merged
merged 3 commits into from
Apr 4, 2022
Merged

Conversation

jaeheonji
Copy link
Contributor

@jaeheonji jaeheonji commented Mar 10, 2022

This PR resolve #1240

What kind of change does this PR introduce?

  • Fix

Did this PR introduce a breaking change?

  • No

The content in #1217 is getting long, so I'm making this PR with a new alternative.
I hadn't thought of this PR (#1072), so currently Neovide.app cannot be run through Finder on macOS.

However, this still leaves some problems.

For example, if neovim is installed through brew, it will not run (in Finder) because nvim does not exist in the PATH variable (default installation path is /opt/homebrew/bin/).

But one thing I'm concerned about is that hardcoding the settings of a 3rd party app has maintenance issues later on.
So, if there is a better way, please give feedback.

EDIT: Thank you, everyone. I removed direct hardcoding of brew to PATH and added a way to solve this problem instead.

@danielnehrig
Copy link

danielnehrig commented Mar 23, 2022

For example, if neovim is installed through brew, it will not run (in Finder) because nvim does not exist in the PATH variable (default installation path is /opt/homebrew/bin/).

I don't understand really... if neovim is not part of the Path, that means one can also not run it in the terminal without specifying the full path to the binary. This looks rather like a local dev setup thing problem. I think hardcoding the path like this is not a solution, especially not for a broader audience, as for me the /opt/homebrew does not even exist. And the default installation path of my neovim is /usr/local/bin/nvim in my case.

and yes i use brew to install neovim

@jaeheonji
Copy link
Contributor Author

jaeheonji commented Mar 23, 2022

@danielnehrig Thanks for your feedback

I think hardcoding the path like this is not a solution

Yes, I agree 100%. As I have already said, this is a very bad idea. And, in your environment this shouldn't be a problem. Because, it's more correct to say that this is a problem in the brew used by Apple Slicon.

When installing nvim through brew in Intel X86 environment, it is installed as /usr/local path, but in case of M1, it is installed as /opt/homebrew. And since this is not a general $PATH environment, the .app file cannot be executed through Finder.

I tried to assign --neovim-bin directly through .plist modification, but it still doesn't work. (Of course, I could be wrong about this.)

It would be nice to have a more fundamental solution, but I actually don't know a good solution yet. (This PR is just one example.)

One way to avoid modifying the code is simply to create an nvim symbolic link in the /usr/loacl/bin path only for M1 users.

@danielnehrig
Copy link

danielnehrig commented Mar 24, 2022

what about let the user fill out the path himself in this case add /opt/homebrew
reading the current loaded shell which is set in /etc/passwd and set via pwd or use /bin/sh since it's a symlink
and launch neovide with the shell containing your set path

@jaeheonji
Copy link
Contributor Author

Sorry! please make sure I understand correctly.

Is your intention correct to mean that the user registers neovim path to the $PATH "by himself" in the current default shell, and then loads the shell configuration (with $PATH) before neovide is run?

@henryhchchc
Copy link

I found a section in Homebrew documentation talking about this issue. Hope it helps.

@jaeheonji
Copy link
Contributor Author

@henryhchchc Oh! Thanks 😄 I didn't know that.

@Kethku Kethku merged commit 65c2341 into neovide:main Apr 4, 2022
@owittek
Copy link

owittek commented Dec 16, 2022

I found a section in Homebrew documentation talking about this issue. Hope it helps.

This seems to work for opening the GUI in finder but it is still not possible to open it from spotlight/alfred. Symlinking nvim to /usr/local/bin ( ln -s /opt/homebrew/bin/nvim /usr/local/bin/nvim ) fixes that but neovide will always launch in the /usr/local/bin folder which seems to break the telescope plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Neovide.app wont Open in Finder, but opens if alias in the terminal
5 participants