neovide icon indicating copy to clipboard operation
neovide copied to clipboard

Neovide doesn't opens on MacOS

Open emakei opened this issue 1 year ago ā€¢ 20 comments

Describe the bug Nothing happens when I'm try to open app from Finder or panel. But if use command "open Neovide.app" from shell then works fine

To Reproduce Steps to reproduce the behavior:

  1. Install or build from source app
  2. Bundle if builded from sources
  3. Try open app

Expected behavior App should opens as regular application

Desktop (please complete the following information):

  • OS: 13.3.1 (22E261)
  • Neovide Version 0.10.4
  • Neovim Version 0.9.0

Additional context Ctrl+Click doesn't help

emakei avatar May 04 '23 22:05 emakei

This is affecting me as of yesterday after a brew upgrade - have been using Neovide as daily driver successfully for months, but also tried the solution(s) in #1175 just in case. Works when run as neovide or open /Applications/Neovide.app from shell.

How can I enable/view logs when launching from Finder/Alfred/etc?

dashkb avatar May 05 '23 16:05 dashkb

If it runs when you open it from shell, it's most likely caused by the PATH variable. Be careful where you add the path containing nvim executable to the PATH. When opened from shell, the process inherits the variable from shell, so it works just fine. E.g. neovide won't work if you add it in .zshrc, but it will work fine if you add it in .zshenv. That's because .zshrc is read only by interactive shells.

MPWrobel avatar May 09 '23 21:05 MPWrobel

Getting the same issue, however I use fish, not zsh, and there's no difference in setting the homebrew path in config.fish or under conf.d

bnwa avatar May 14 '23 03:05 bnwa

Also exported NEOVIM_BIN directly as a global var to avoid the path lookup, same issue

bnwa avatar May 14 '23 03:05 bnwa

If it runs when you open it from shell, it's most likely caused by the PATH variable. Be careful where you add the path containing nvim executable to the PATH. When opened from shell, the process inherits the variable from shell, so it works just fine. E.g. neovide won't work if you add it in .zshrc, but it will work fine if you add it in .zshenv. That's because .zshrc is read only by interactive shells.

Great tip and good best practice, corrected to match this (correct) dotfiles configuration and works great. Thanks!

netfizz-se avatar May 16 '23 10:05 netfizz-se

@bnwa and other fish users - looks like Finder is using zsh's environment, irrespective of configured login shell. Adding /opt/homebrew/bin to .zshenv has everything working again for me, even though I've only ever used zsh on this machine for the minute it took to get fish. :shrug:

It wasn't necessary prior to my most recent software update - I did brew upgrade and Apple's most recent security patches at the same time so it's unclear if I messed it up or Apple did.

dashkb avatar May 16 '23 18:05 dashkb

I think i'm facing the same or a similar issue. Neovide was opening from the dock/spotlight fine until my MacBook had a kernel panic and rebooted. I'm pretty sure Neovide was open when this happened now I can't open Neovide from finder, dock, or spotlight anymore.

running from terminal: $ open -a Neovide.app does nothing, but: $ neovide opens as expected.

Neovide 0.10.3, nvim 0.8.2 both installed via homebrew MacOS Monterey 12.4 (M1 MacBook Air 2020)

cobbm avatar May 16 '23 19:05 cobbm

@cobbm that sounds more like a symptom of Apple's security than the PATH issue. Have you ensured via System Prefs -> Security that Neovide is whitelisted? Failing to open via Terminal with open suggests a (as you said) similar but not identical issue to the one I solved. Also congrats/sorry on that kernel panic, you must have really been punishing that MacBook. šŸ˜›

dashkb avatar May 16 '23 19:05 dashkb

@dashkb Weird, I've just ran brew upgrade, now on neovide 0.10.4, and I can open from spotlight/dock again. Maybe some config file got trashed when my system crashed?

hahah, I wish, I literally closed the laptop lid before bed and then this morning i woke up to a fresh boot and "your computer restarted because of a problem". oh well, all is well!

cobbm avatar May 16 '23 19:05 cobbm

@bnwa and other fish users - looks like Finder is using zsh's environment, irrespective of configured login shell. Adding /opt/homebrew/bin to .zshenv has everything working again for me, even though I've only ever used zsh on this machine for the minute it took to get fish. šŸ¤·

It wasn't necessary prior to my most recent software update - I did brew upgrade and Apple's most recent security patches at the same time so it's unclear if I messed it up or Apple did.

Good to know. In my case, however, not one of the following got things working:

  • Homebrew asks users to append eval $(/opt/homebrew/bin/brew shellenv) to .zprofile, which I believe is sourced for non-interactive shells. As I'd already done this on my way to fish, this would have been my case knowing now that Finder is bound to zsh. However the issue persisted.
  • I then removed this and exported the correct PATH in .zshenv. This also did not work.
  • I removed that and then export NEOVIM_BIN in .zshenv and that didn't work.

Maybe I got something wrong though or there's another factor eluding my observation

bnwa avatar May 16 '23 19:05 bnwa

Stupid question - did you restart Finder and/or the whole Mac?

On Tue, May 16, 2023 at 1:50 PM bnwa @.***> wrote:

@bnwa https://github.com/bnwa and other fish users - looks like Finder is using zsh's environment, irrespective of configured login shell. Adding /opt/homebrew/bin to .zshenv has everything working again for me, even though I've only ever used zsh on this machine for the minute it took to get fish. šŸ¤·

It wasn't necessary prior to my most recent software update - I did brew upgrade and Apple's most recent security patches at the same time so it's unclear if I messed it up or Apple did.

Good to know. In my case, however, not one of the following got things working:

  • Homebrew asks users to append eval $(/opt/homebrew/bin/brew shellenv) to .zprofile, which I believe is sourced for non-interactive shells. As I'd already done this on my way to fish, this would have been my case knowing now that Finder is bound to zsh. However the issue persisted.
  • I then removed this and exported the correct PATH in .zshenv. This also did not work.
  • I removed that and then export NEOVIM_BIN in .zshenv and that didn't work.

Maybe I got something wrong though or there's another factor eluding my observation

ā€” Reply to this email directly, view it on GitHub https://github.com/neovide/neovide/issues/1859#issuecomment-1550271392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABODZ656C253UN6HWNKJNLXGPLCHANCNFSM6AAAAAAXWMI23U . You are receiving this because you were mentioned.Message ID: @.***>

dashkb avatar May 17 '23 01:05 dashkb

@dashkb No dice either relaunching Finder or restarting with the means listed above

bnwa avatar May 17 '23 14:05 bnwa

@bnwa bummer! Wish I could help more but having solved it for myself I'm not sure what else to try. I might even be wrong about the Finder/zsh relationship. šŸ˜¬ Finding a way to get at Neovide's logs from a broken launch seems like the obvious next step, but it's not obvious how to do it.

dashkb avatar May 17 '23 17:05 dashkb

I have the same issue (able to launch from the terminal but not by using the Finder). If that can help, here are the logs from the Console when I click on the Neovide icon.

erreur	22:39:41.276853+0200	tccd	Failed to get code reference from: <TCCDProcess: identifier=com.neovide.neovide, pid=35850, auid=501, euid=501, binary_path=/Applications/neovide.app/Contents/MacOS/neovide>. -67065
erreur	22:39:41.280287+0200	tccd	Failed to create SecCodeRef for PID[35850]: 100003.
erreur	22:39:41.281203+0200	WindowServer	CGXRegisterForPortNotification: mach_port_request_notification: (os/kern) invalid argument
erreur	22:39:41.280807+0200	tccd	Refusing TCCAccessRequest for service kTCCServiceListenEvent from extension Sub:{com.neovide.neovide}Resp:{<TCCDProcess: identifier=com.neovide.neovide, pid=35850, auid=501, euid=501, binary_path=/Applications/neovide.app/Contents/MacOS/neovide>} due to security policy
erreur	22:39:41.385087+0200	runningboardd	Launchd didn't have information for pid 35849, reason: Error Domain=NSPOSIXErrorDomain Code=113 "Unknown error: 113"

manumacro avatar May 24 '23 20:05 manumacro

@bnwa (and other Fishies) - the fish docs warn of just this kind of PATH issue. Unless you are doing something fancy with fish on login, you could set your system shell back to zsh and have your terminal emulator launch fish.

@manumacro your logs are complaining about security, have you given Neovide permission to launch in Settings > Security yet?

dashkb avatar May 27 '23 00:05 dashkb

@bnwa (and other Fishies) - the fish docs warn of just this kind of PATH issue. Unless you are doing something fancy with fish on login, you could set your system shell back to zsh and have your terminal emulator launch fish.

@manumacro your logs are complaining about security, have you given Neovide permission to launch in Settings > Security yet?

That was indeed the issue, thanks for pointing that out

bnwa avatar May 27 '23 14:05 bnwa

šŸŽ‰ Iā€™m glad I stumbled across a solution.

dashkb avatar May 27 '23 23:05 dashkb

It would be great if someone could submit a pull request with a FAQ entry for this. I don't think we can resolve it inside Neovide itself.

fredizzimo avatar Jul 26 '23 14:07 fredizzimo

@bnwa and other fish users - looks like Finder is using zsh's environment, irrespective of configured login shell. Adding /opt/homebrew/bin to .zshenv has everything working again for me, even though I've only ever used zsh on this machine for the minute it took to get fish. šŸ¤·

It wasn't necessary prior to my most recent software update - I did brew upgrade and Apple's most recent security patches at the same time so it's unclear if I messed it up or Apple did.

this worked for me, i added: export PATH=/opt/homebrew/bin:$PATH to the .zshenv file and neovide works again.

clhernandez avatar Jul 26 '23 18:07 clhernandez

This just needs a documentation update, so marked as "good first issue"

fredizzimo avatar Jul 31 '23 12:07 fredizzimo

Some extra instructions was add at our documentation to help out during installation.

falcucci avatar Jul 10 '24 15:07 falcucci