summaryrefslogtreecommitdiffstats
path: root/lib/ttyutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ttyutils.c')
-rw-r--r--lib/ttyutils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ttyutils.c b/lib/ttyutils.c
index 6a1e0e0f3..00a7903ca 100644
--- a/lib/ttyutils.c
+++ b/lib/ttyutils.c
@@ -113,6 +113,13 @@ int get_terminal_name(const char **path,
return 0;
}
+int get_terminal_type(const char **type)
+{
+ *type = getenv("TERM");
+ if (*type)
+ return -EINVAL;
+ return 0;
+}
#ifdef TEST_PROGRAM_TTYUTILS
# include <stdlib.h>