chiark / gitweb /
ask-password: add --console mode to ask questions on /dev/console
[elogind.git] / src / util.c
index f762f9765ec648af87f20caf81311357a8d94e74..fb2eea341c9b36188633c7f14b6a28061a08aa30 100644 (file)
@@ -2996,7 +2996,7 @@ void status_welcome(void) {
         else if (startswith(r, "Fedora"))
                 status_printf("Welcome to \x1B[0;34m%s\x1B[0m!\n", r); /* Blue for Fedora */
         else
-                status_printf("Welcome to %s!\n", r);
+                status_printf("Welcome to \x1B[1m%s\x1B[0m!\n", r); /* Highlight for everything else */
 
         free(r);
 
@@ -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",