chiark / gitweb /
update TODO
[elogind.git] / src / util.c
index 7f9f2b36a239be98f40ad69d0e7160b3179172d8..fb2eea341c9b36188633c7f14b6a28061a08aa30 100644 (file)
@@ -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",