X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.c;h=fb2eea341c9b36188633c7f14b6a28061a08aa30;hb=74fe1fe36e35a26d764f1e3119d5f6d014db573c;hp=f762f9765ec648af87f20caf81311357a8d94e74;hpb=7f4e08056de0184b205a20632e62db73d299937e;p=elogind.git diff --git a/src/util.c b/src/util.c index f762f9765..fb2eea341 100644 --- a/src/util.c +++ b/src/util.c @@ -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",