From 7a372b0f4627b9482d1276238348a1432c13fbe3 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Thu, 16 May 2013 22:49:13 +0200 Subject: Implement term-output-format --- src/auto_detect_format.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/auto_detect_format.c') diff --git a/src/auto_detect_format.c b/src/auto_detect_format.c index 6ec5f73..524e2e9 100644 --- a/src/auto_detect_format.c +++ b/src/auto_detect_format.c @@ -30,6 +30,11 @@ * */ char *auto_detect_format(void) { + /* If stdout is a tty, we output directly to a terminal. */ + if (isatty(STDOUT_FILENO)) { + return "term"; + } + pid_t myppid = getppid(); pid_t mypid = getpid(); -- cgit v1.2.3