noice truncates the cwd string dynamically. If the numbers of columns is lesser than the length of the path, cwd is truncated so that the correct path cannot be resolved. We should try to resolve the full path instead.
The contents of the directory may be changed from the shell by adding or deleting content. Permissions may have changed too. We must re-populate the contents of the current directory.
Once set, the default filter is updated. This means that
toggle dot will also work as expected when noice is executed
as root.
Based on discussion with Ypnose.
The magic.mgc file gets created in the local directory, opening
the global file throws unwanted messages. So we are using the o/p
of the file command to determine if the file is a plain text file.
NetBSD has its own curses implementation and initscr() does not
terminate with an error if TERM is not set properly.
Instead check the return value and exit if an initialization
error occurs.
Specifying commands by name in config.h means that
every time one switches ones editor (for example),
one has to modify every config.h file referencing that editor
and then recompile every corresponding program.
This change adds a string `env` for specifying an environment
variable to `struct key` and uses it to optionally specify the
command to run on SEL_{RUN,RUNARG}.
The `run` string is used as a fallback when the environment variable
has not been specified or is not set.
It also updates `config.def.h` to demonstrate this new capability.