kdb-editor tries to spawn /usr/bin/sensible-editor first, which usually is a script that honors EDITOR. This seems not to work for Mac OS X.
@sanssecours Does 6add37ae2d72755a976a826f3ec187d03c44f868 what you want?
@sanssecours Does 6add37a what you want?
Yes, thank you 😘.
I was wondering if we also need a search within PATH. (Same for the man-tool).
Please reopen if anything does not work as expected.
I was wondering if we also need a search within
PATH.
That would be a great feature addition. As far as I can remember other Unix tools I used (e.g. git, ghci) search for EDITOR inside PATH. The TextMate Manual also specifies EDITOR without absolute path.
My research (a.k.a. Google search via DuckDuckGo) also revealed that it might make sense to also support the variable VISUAL. At least git seems to prefer VISUAL over EDITOR.
Ok, I agree that PATH should be used, maybe with /bin, /usr/bin additionally hardcoded as fallbacks?
VISUAL
Yes, you are right, VISUAL should be preferred. (Also done by sensible-editor this way).
If we also support SELECTED_EDITOR and the config file ~/.selected_editor we completely reimplemented what /usr/bin/sensible-editor is doing ;)
Maybe we should have PATH and an equivalent to ~/.selected_editor (the user's preferred editor) within KDB.
Ok, I agree that
PATHshould be used, maybe with/bin,/usr/binadditionally hardcoded as fallbacks?
Using a fallback would make sense, although I think just using the directories in the current PATH should be enough in most use cases.
Maybe we should have
PATHand an equivalent to~/.selected_editor(the user's preferred editor) within KDB.
Since PATH is such an often used environment variable, I think adding support for it to KDB would make sense. I am not so sure about selected_editor. On the other hand we already have code to detect the users preferred editor. We might as well use this code to make it easier for other tools to detect a ”sensible” editor editor via a simple invocation of kdb. If we really add support for this feature, then we should also use ed as last fall back, and maybe even prefer pico or nano over vi.
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions :sparkling_heart:
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions :sparkling_heart:
Most helpful comment
@sanssecours Does 6add37ae2d72755a976a826f3ec187d03c44f868 what you want?