From: Andre Noll Date: Sun, 23 Mar 2025 13:54:12 +0000 (+0100) Subject: com_log(): Run less with -r to display control characters. X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=d40c3ba3e2afefd046d08a1e1941986c55bc1964;p=micoforia.git com_log(): Run less with -r to display control characters. --- diff --git a/micoforia.c b/micoforia.c index d23566c..83f2c95 100644 --- a/micoforia.c +++ b/micoforia.c @@ -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;