Ticket #816 (closed task: fixed)
In addition of $EDITOR, support $VISUAL too
| Reported by: | tuju | Owned by: | dgollub |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | osynctool/msynctool | Version: | 0.37 |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
man less
v Invokes an editor to edit the current file being viewed. The editor
is taken from the environment variable VISUAL if defined, or EDITOR
if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor
EDITOR is defined.
I wouldn't be surprised that it's been defined in some POSIX specs, but regardless of that, we could support old farts using the $VISUAL too. :)
Change History
comment:2 Changed 5 years ago by tuju
Didn't find POSIX definition for this, but many other sources claim VISUAL over EDITOR like:
http://www.mkssoftware.com/docs/man1/sh.1.asp#ENVIRONMENT_VARIABLES http://seejeffrun.blogspot.com/2008/07/setting-defaults-properly.html
and when failing on those, then trying to launch vi.
Note: See
TracTickets for help on using
tickets.

Should we switch EDITOR and VISUAL?
#ifdef _WIN32 editcmd = g_strdup_printf("notepad %s", tmpfile); #else if (!(editor = getenv("EDITOR"))) editor = getenv("VISUAL"); if (editor) editcmd = g_strdup_printf("%s %s", editor, tmpfile); else editcmd = g_strdup_printf("vi %s", tmpfile); #endif