pimterry / notes

:pencil: Simple delightful note taking, with more unix and less lock-in.
https://github.com/pimterry/notes
MIT License
1.24k stars 82 forks source link

'notes o' says it can't get a file descriptor on Linux #57

Open rmNULL opened 6 years ago

rmNULL commented 6 years ago

Issue Summary

notes o doesn't open a directory as expected to.

Steps to Reproduce

  1. notes o

    Couldn't get a file descriptor referring to the console

notes open

Apparently, open command gives the same error message, on the device I tried. In another device, $ notes o reports "open: command not found"

Technical details:

P.S: If output of any relevant commands will help, let me know. I'll be glad to paste it here.

primis commented 6 years ago

Could you output the result of the EDITOR variable? echo $EDITOR should do the trick. I have a feeling that this is due to you having editor set to a GUI editor or some weird default on the raspi. Also, is your notes configuration the default one? if not please include that in your reply

rmNULL commented 6 years ago

1) $EDITOR is set to nvim btw notes n works fine , so the case when notes o is passed a filename. e.g: notes o ca.sh open a file. but notes o gives the error message shown above.

2) Yes I use the default configuration.

Relevant? https://unix.stackexchange.com/questions/253376/open-command-to-open-a-file-in-an-application

pimterry commented 6 years ago

Huh, interesting. That stackexchange answer is very useful. As far as I can tell this has never worked in linux, as it expects open to be the OSX command (which opens the file with the default handler), but open on most (all?) Linux OSs is a totally different thing.

We need to somehow fix that. A few options:

I think I'm leaning towards the 2nd option. Thoughts?

rmNULL commented 6 years ago

I would prefer the 2nd option, we would also need to consider for BSD devices. I'll make a draft pull request. Throw in your suggestions.

edit: Windows - start.exe

Escyll commented 3 years ago

I might be late to the party here. There is a charm to the 4th option as well. On command-line I like to use the ranger file manager, but for UI related stuff I use dolphin as my file manager. However, I think that option 2 and 4 are orthogonal to each other: Having an option to overrule a, in 90% of the cases, good default (like xdg-open, open and start.exe).