summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 7f9f2b36a2..fb2eea341c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3470,6 +3470,21 @@ void filter_environ(const char *prefix) {
environ[j] = NULL;
}
+const char *default_term_for_tty(const char *tty) {
+ assert(tty);
+
+ if (startswith(tty, "/dev/"))
+ tty += 5;
+
+ if (startswith(tty, "tty") &&
+ tty[3] >= '0' && tty[3] <= '9')
+ return "TERM=linux";
+
+ /* FIXME: Proper handling of /dev/console would be cool */
+
+ return "TERM=vt100-nav";
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",