mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix #231
This commit is contained in:
parent
6d023d7877
commit
fa31775547
|
@ -369,6 +369,7 @@ The following indicators are used in the detail view:
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `NNN_BMS='d:~/Documents;D:~/Docs archive/'` | specify bookmarks (max 10) |
|
| `NNN_BMS='d:~/Documents;D:~/Docs archive/'` | specify bookmarks (max 10) |
|
||||||
| `NNN_OPENER=mimeopen` | custom file opener |
|
| `NNN_OPENER=mimeopen` | custom file opener |
|
||||||
|
| `NNN_OPENER_DETACH=1` | do not block when invoking file opener |
|
||||||
| `NNN_CONTEXT_COLORS='1234'` | specify per context color [default: '4444' (all blue)] |
|
| `NNN_CONTEXT_COLORS='1234'` | specify per context color [default: '4444' (all blue)] |
|
||||||
| `NNN_IDLE_TIMEOUT=300` | idle seconds before locking terminal [default: disabled] |
|
| `NNN_IDLE_TIMEOUT=300` | idle seconds before locking terminal [default: disabled] |
|
||||||
| `NNN_COPIER='copier.sh'` | system clipboard copier script [default: none] |
|
| `NNN_COPIER='copier.sh'` | system clipboard copier script [default: none] |
|
||||||
|
|
5
nnn.1
5
nnn.1
|
@ -155,6 +155,11 @@ when dealing with the !, e and p commands respectively. A single combination to
|
||||||
export NNN_OPENER=mimeopen
|
export NNN_OPENER=mimeopen
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
|
\fBNNN_OPENER_DETACH:\fR do not block when invoking file opener.
|
||||||
|
.Bd -literal
|
||||||
|
export NNN_OPENER_DETACH=1
|
||||||
|
.Ed
|
||||||
|
.Pp
|
||||||
\fBNNN_CONTEXT_COLORS:\fR string of color codes for each context, e.g.:
|
\fBNNN_CONTEXT_COLORS:\fR string of color codes for each context, e.g.:
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
export NNN_CONTEXT_COLORS='1234'
|
export NNN_CONTEXT_COLORS='1234'
|
||||||
|
|
11
src/nnn.c
11
src/nnn.c
|
@ -256,6 +256,7 @@ static bm bookmark[BM_MAX];
|
||||||
static size_t g_tmpfplen; /* path to tmp files for copy without X, keybind help and file stats */
|
static size_t g_tmpfplen; /* path to tmp files for copy without X, keybind help and file stats */
|
||||||
static uchar g_crc;
|
static uchar g_crc;
|
||||||
static uchar BLK_SHIFT = 9;
|
static uchar BLK_SHIFT = 9;
|
||||||
|
static uchar opener_flag = F_NOTRACE;
|
||||||
static bool interrupted = FALSE;
|
static bool interrupted = FALSE;
|
||||||
|
|
||||||
/* Retain old signal handlers */
|
/* Retain old signal handlers */
|
||||||
|
@ -362,9 +363,10 @@ static const char * const messages[] = {
|
||||||
#define NNN_NO_AUTOSELECT 10
|
#define NNN_NO_AUTOSELECT 10
|
||||||
#define NNN_RESTRICT_NAV_OPEN 11
|
#define NNN_RESTRICT_NAV_OPEN 11
|
||||||
#define NNN_RESTRICT_0B 12
|
#define NNN_RESTRICT_0B 12
|
||||||
#define NNN_TRASH 13
|
#define NNN_OPENER_DETACH 13
|
||||||
|
#define NNN_TRASH 14
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#define NNN_OPS_PROG 14
|
#define NNN_OPS_PROG 15
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char * const env_cfg[] = {
|
static const char * const env_cfg[] = {
|
||||||
|
@ -381,6 +383,7 @@ static const char * const env_cfg[] = {
|
||||||
"NNN_NO_AUTOSELECT",
|
"NNN_NO_AUTOSELECT",
|
||||||
"NNN_RESTRICT_NAV_OPEN",
|
"NNN_RESTRICT_NAV_OPEN",
|
||||||
"NNN_RESTRICT_0B",
|
"NNN_RESTRICT_0B",
|
||||||
|
"NNN_OPENER_DETACH",
|
||||||
"NNN_TRASH",
|
"NNN_TRASH",
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
"NNN_OPS_PROG",
|
"NNN_OPS_PROG",
|
||||||
|
@ -3039,7 +3042,7 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invoke desktop opener as last resort */
|
/* Invoke desktop opener as last resort */
|
||||||
spawn(opener, newpath, NULL, NULL, F_NOTRACE);
|
spawn(opener, newpath, NULL, NULL, opener_flag);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -4103,6 +4106,8 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Get custom opener, if set */
|
/* Get custom opener, if set */
|
||||||
opener = xgetenv(env_cfg[NNN_OPENER], utils[OPENER]);
|
opener = xgetenv(env_cfg[NNN_OPENER], utils[OPENER]);
|
||||||
|
if (getenv(env_cfg[NNN_OPENER_DETACH]))
|
||||||
|
opener_flag |= F_NOWAIT;
|
||||||
|
|
||||||
/* Set nnn nesting level, idletimeout used as tmp var */
|
/* Set nnn nesting level, idletimeout used as tmp var */
|
||||||
idletimeout = xatoi(getenv(env_cfg[NNNLVL]));
|
idletimeout = xatoi(getenv(env_cfg[NNNLVL]));
|
||||||
|
|
Loading…
Reference in a new issue