From cc357231b343a9ab2b48a737f923e49a2bb721d2 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 6 Sep 2016 08:15:21 -0400 Subject: [PATCH] TS-29: tasksh hangs trying to read task from stdin - Thanks to ilove zfs. --- AUTHORS | 1 + ChangeLog | 5 +++-- src/main.cpp | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1820ae5..d235335 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,6 +8,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Jörg Krause Ben Boeckel + ilove zfs Thanks to the following, who submitted detailed bug reports and excellent suggestions: diff --git a/ChangeLog b/ChangeLog index 82feb02..bf3a024 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ -1,2,0 () - +1.2.0 () - -- +- TS-29 tasksh hangs trying to read task from stdin + (thanks to ilove zfs). ------ current release --------------------------- diff --git a/src/main.cpp b/src/main.cpp index 556e7b3..9025a21 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #ifdef HAVE_READLINE @@ -125,6 +126,8 @@ static int commandLoop (bool autoClear) // cause the shell to terminate. } } + else + status = 1; return status; } @@ -155,7 +158,9 @@ int main (int argc, const char** argv) output == "yes\n" || output == "on\n"); - welcome (); + if (isatty (fileno (stdin))) + welcome (); + while ((status = commandLoop (autoClear)) == 0) ; }