diff options
| author | 2019-01-16 20:11:33 +0530 | |
|---|---|---|
| committer | 2019-01-16 20:11:33 +0530 | |
| commit | 5f519841e7b4fa1a752e444a19722f0fe516b026 (patch) | |
| tree | e6ea870a4ca754441395bcf4b980ec3b2ceabc8b /src | |
| parent | e7e09483b61537278da08103cbb72f496f79badb (diff) | |
| download | nnn-5f519841e7b4fa1a752e444a19722f0fe516b026.tar.gz | |
Resurrect NNN_OPENER
Diffstat (limited to 'src')
| -rw-r--r-- | src/nnn.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -297,6 +297,7 @@ static char *pnamebuf, *pcopybuf; static int ndents, cur, total_dents = ENTRY_INCR; static uint idle; static uint idletimeout, copybufpos, copybuflen; +static char *opener; static char *copier; static char *editor; static char *pager, *pager_arg; @@ -2157,6 +2158,8 @@ static bool show_help(char *path) dprintf(fd, "\n"); } + if (getenv("NNN_OPENER")) + dprintf(fd, "NNN_OPENER: %s\n", opener); if (cfg.useeditor) dprintf(fd, "NNN_USE_EDITOR: 1\n"); if (getenv("NNN_CONTEXT_COLORS")) @@ -2793,7 +2796,7 @@ nochange: } /* Invoke desktop opener as last resort */ - spawn(utils[OPENER], newpath, NULL, NULL, F_NOWAIT | F_NOTRACE); + spawn(opener, newpath, NULL, NULL, F_NOWAIT | F_NOTRACE); continue; } default: @@ -3767,6 +3770,11 @@ int main(int argc, char *argv[]) } #endif + /* Get custom opener, if set */ + opener = getenv("NNN_OPENER"); + if (!opener) + opener = utils[OPENER]; + /* Get locker wait time, if set; copier used as tmp var */ copier = getenv("NNN_IDLE_TIMEOUT"); if (copier) { |