-
Notifications
You must be signed in to change notification settings - Fork 504
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
Macos open with doesnt work #1682
Comments
Does opening via Spotlight work? Might be related to my issue (#1679 (comment)) |
Same issue here.
|
fyi this problem has been reported multiple times. +1 i would also like to have this. hopefully someday someone will make a PR for this |
tried messing around a little creating a dummy project which is just
then I bundled this using cargo bundle when I set it as default for any file and double click MacOS does not pass any extra arguments. If anybody can direct me to some piece of documentation i would be glad to open a pr about this |
Maybe the way neovide is bundled, it is ignoring the filename argument passed by macos when you set neovide as default application for opening a file. Instead it is looking for explicit arguments passed through 'open --args'. |
The Finder does not pass arguments. It uses Apple Events for this. This is because you can also open files in apps that are already running by dragging the file over the app icon in the dock. |
I see let me see that route then @kabouzeid thanks for the info |
I have no idea. I wanted to fix this myself, then finally found out about Apple Events, and then lost interest :D |
okay i will try to test thanks for the headers anyway :D |
I figured getting filepath out before i open a pr wanted to ask which would be a better way to handle openFile events on mac
which would be a better way to handle macos doubleclick openfile requests and potentially future file clicks by user as the app runs? |
I just dont understand how parts communicate on the entire codebase couldn't find anything that could potentially help me open a new buffer or send a raw command to neovim what am i missing here ? |
This is probably the best approach, it would behave the same on all platforms.
This would be the correct approach, but it would be better to implement this for all platforms, instead of having macos specific behavior.
I think using the first approach is better right now, users would have a working |
I think the arguments are just passed to the |
@sharpenedblade the issue is that openfile event could come any moment after the app is opened so i think would be better to be able to listen throughout the life of neovide process however still i could not figure out how i exactly open new buffers from neovide in rust |
If the user is opening a file using |
and if user clicks a file when a neovide process is already running then that process will receive the notification not a new one |
I think it would be better to just handle it with the "naive" approach, then design a solution for all platforms. After this is working, then we could implement a system to handle new file opens on all platforms, and just handle |
Same issue. macOS: By default, Neovide isn't enabled for supported files in the Application selection picker. Then, if we force the file to open with a Neovide, it results in an error:
It's pretty annoying. So, I switched to |
MacVim is just vim not neovim isnt it? also neovide comes with some pretty cool animations besides its a community project so I dont think your approach of treating it as a product is correct |
If you are still wondering about the implementation, you should be able to to use the Lines 199 to 205 in eeac6e7
You just need to wait until Neovim has launched and accepts commands before calling it. |
You're right. It uses Vim but it integrates very well with the macOS ecosystem. Neovide does offer some cool features, but the presence of a few minor bugs makes it unusable for me. I wish I knew Rust, I would have helped. :/ Edit: Grammar |
I think i see the problem. It looks like the dropped file event only applies to dragging into the window, NOT the dock icon. Looking now at winit to see if theres some new event or something |
Indeed, the issue appears to be that whereas From the
|
Related PR #2191 |
I can drag and drop files once the window is open though. |
Same issue. I can open files directly from the console with: $ neovide foo.md I can also drag files onto an existing neovide window and they open correctly, but neither "Open with..." nor double-clicking (with handler set to neovide) works. I get an empty neovide buffer. Side note @bogado, I added this snippet to <key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>All Text Files</string>
<key>LSItemContentTypes</key>
<array>
<string>public.text</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array> |
Looks like @polachok 's PR may address the open-from-finder problem. Fingers crossed... |
This was fixed by: |
I still can't seem to get macOS to see Neovide as something that can open text files... I can right click and select "Get Info" and find it through the menu, but I need to click "All Applications" and still get a warning. I also use OpenIn which is having problems as a result when I set Neovide as the text file opener: |
Ok, re-opening this. |
Describe the bug
trying to open a file with neovide using open with opens an empty neovide instance on mac
To Reproduce
Steps to reproduce the behavior:
Expected behavior
selected file to open in neovide
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: