mirror of
https://github.com/jarun/nnn.git
synced 2024-11-16 08:03:16 +00:00
Update NNN_NOWAIT changes
This commit is contained in:
parent
df4b557ca1
commit
55643a5fcc
12
README.md
12
README.md
|
@ -45,6 +45,8 @@ Noice is Not Noice, a noicer fork...
|
||||||
- [file copy, move, delete](#file-copy-move-delete)
|
- [file copy, move, delete](#file-copy-move-delete)
|
||||||
- [boost chdir prompt](#boost-chdir-prompt)
|
- [boost chdir prompt](#boost-chdir-prompt)
|
||||||
- [set idle timeout](#set-idle-timeout)
|
- [set idle timeout](#set-idle-timeout)
|
||||||
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
- [nnn blocks on opening files](#nnn-blocks-on-opening-files)
|
||||||
- [Why fork?](#why-fork)
|
- [Why fork?](#why-fork)
|
||||||
- [Mentions](#mentions)
|
- [Mentions](#mentions)
|
||||||
- [Developers](#developers)
|
- [Developers](#developers)
|
||||||
|
@ -353,11 +355,13 @@ Any other value disables colored directories.
|
||||||
|
|
||||||
The terminal screensaver is disabled by default. To set the wait time in seconds, use environment variable `NNN_IDLE_TIMEOUT`.
|
The terminal screensaver is disabled by default. To set the wait time in seconds, use environment variable `NNN_IDLE_TIMEOUT`.
|
||||||
|
|
||||||
#### open file in new process and make the nnn not block
|
### Troubleshooting
|
||||||
|
|
||||||
The desktop file opener should take care of opening files in new processes without causing `nnn` to block.
|
#### nnn blocks on opening files
|
||||||
If `nnn` does block/freeze when a file is open, then set the environment variable `NNN_NOWAIT` to any
|
|
||||||
non-zero value.
|
Ideally nnn should not block. Unfortunately, sometimes even the same desktop opener behaves differently on different Linux desktop environments. If `nnn` does block when a file is open, set the environment variable `NNN_NOWAIT` to any non-zero value. For example,
|
||||||
|
|
||||||
|
export NNN_NOWAIT=1
|
||||||
|
|
||||||
### Why fork?
|
### Why fork?
|
||||||
|
|
||||||
|
|
3
nnn.1
3
nnn.1
|
@ -208,8 +208,7 @@ screensaver.
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_NOWAIT:\fR make nnn not block while a file is open. Only necessary if
|
\fBNNN_NOWAIT:\fR necessary only if nnn blocks while a file is open.
|
||||||
nnn is blocking while a file is open.
|
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
export NNN_NOWAIT=1
|
export NNN_NOWAIT=1
|
||||||
.Ed
|
.Ed
|
||||||
|
|
4
nnn.c
4
nnn.c
|
@ -222,7 +222,7 @@ static char *player;
|
||||||
static char *copier;
|
static char *copier;
|
||||||
static char *editor;
|
static char *editor;
|
||||||
static char *desktop_manager;
|
static char *desktop_manager;
|
||||||
static char nowait;
|
static char nowait = F_NOTRACE;
|
||||||
static blkcnt_t ent_blocks;
|
static blkcnt_t ent_blocks;
|
||||||
static blkcnt_t dir_blocks;
|
static blkcnt_t dir_blocks;
|
||||||
static ulong num_files;
|
static ulong num_files;
|
||||||
|
@ -2865,7 +2865,7 @@ main(int argc, char *argv[])
|
||||||
copier = getenv("NNN_COPIER");
|
copier = getenv("NNN_COPIER");
|
||||||
|
|
||||||
/* Get nowait flag */
|
/* Get nowait flag */
|
||||||
nowait = F_NOTRACE | (getenv("NNN_NOWAIT") ? F_NOWAIT : 0);
|
nowait |= getenv("NNN_NOWAIT") ? F_NOWAIT : 0;
|
||||||
|
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue