aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index c018c46..45f6c23 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -780,13 +780,18 @@ static bool showcplist()
/* Initialize curses mode */
static bool initcurses(void)
{
- if (initscr() == NULL) {
+ if (cfg.picker) {
+ if (!newterm(NULL, stderr, stdin)) {
+ fprintf(stderr, "newterm!\n");
+ return FALSE;
+ }
+ } else if (!initscr()) {
char *term = getenv("TERM");
if (term != NULL)
fprintf(stderr, "error opening TERM: %s\n", term);
else
- fprintf(stderr, "initscr() failed\n");
+ fprintf(stderr, "initscr!\n");
return FALSE;
}
@@ -3592,8 +3597,8 @@ int main(int argc, char *argv[])
}
/* Confirm we are in a terminal */
- if (!isatty(0) || !isatty(1)) {
- fprintf(stderr, "stdin or stdout is not a tty\n");
+ if (!cfg.picker && !(isatty(0) && isatty(1))) {
+ fprintf(stderr, "stdin/stdout !tty\n");
return 1;
}