]> git.tuebingen.mpg.de Git - micoforia.git/commitdiff
com_log(): Run less with -r to display control characters.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 23 Mar 2025 13:54:12 +0000 (14:54 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 23 Mar 2025 13:54:12 +0000 (14:54 +0100)
micoforia.c

index d23566c153ef20b605c860f668d4417beb6ef7c6..83f2c95fbc94026cfa2c1f3d123f4674069bb70d 100644 (file)
@@ -1980,13 +1980,18 @@ static bool com_log(void)
        int ret;
        char *errctx, *logfile;
        bool success, use_less = isatty(STDIN_FILENO) && isatty(STDOUT_FILENO);
-       char *argv[] = {use_less? "less" : "cat", NULL /* filename */, NULL};
+       char *argv[] = {
+               use_less? "less" : "cat",
+               use_less? "-r" : "-u", /* -u has no effect */
+               NULL /* filename */,
+               NULL
+       };
 
        ret = lls_check_arg_count(sublpr, 1, 1, &errctx);
        if (ret < 0)
                die_lopsub(ret, &errctx);
        logfile = get_container_logfile(lls_input(0, sublpr));
-               argv[1] = logfile;
+               argv[2] = logfile;
        success = xexec(argv);
        free(logfile);
        return success;