aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pw.c b/pw.c
index d471286..2ef63a5 100644
--- a/pw.c
+++ b/pw.c
@@ -840,7 +840,8 @@ int main(int argc, char **argv)
if (!ferror(stdin))
exit_status = 0;
if (auto_quit) {
- clrline();
+ if ((stat & stat_bkgnd) == 0)
+ clrline();
break;
}
}
@@ -1348,7 +1349,11 @@ int main(int argc, char **argv)
}
}
}
- clrline();
- ttyset(ttyfd, &tty_saved);
+
+ if ((stat & stat_bkgnd) == 0) {
+ clrline();
+ ttyset(ttyfd, &tty_saved);
+ }
+
return exit_status;
}