aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ponymix.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ponymix.cc b/ponymix.cc
index 48a751e..37dec3f 100644
--- a/ponymix.cc
+++ b/ponymix.cc
@@ -472,7 +472,8 @@ static const std::pair<const string, const Command>& string_to_command(
}
static void version() {
- execlp("ponysay", "ponysay", "-b", "", "ponymix " PONYMIX_VERSION, NULL);
+ if (isatty(fileno(stdout)))
+ execlp("ponysay", "ponysay", "-b", "", "ponymix " PONYMIX_VERSION, NULL);
// Some people are pony haters.
fputs("ponymix v" PONYMIX_VERSION "\n", stdout);