From: Lennart Poettering Date: Fri, 19 Jan 2024 23:00:20 +0000 (+0100) Subject: nspawn: tint the terminal bg blue if we are in a container X-Git-Tag: v256-rc1~1061^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F31026%2Fhead;p=thirdparty%2Fsystemd.git nspawn: tint the terminal bg blue if we are in a container Let's give people a hint that they are not operating on the host. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 5820be8d136..50bb0565cab 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -5355,7 +5355,15 @@ static int run_container( arg_console_width, arg_console_height); - if (!isempty(arg_background)) + if (!arg_background) { + _cleanup_free_ char *bg = NULL; + + r = terminal_tint_color(220 /* blue */, &bg); + if (r < 0) + log_debug_errno(r, "Failed to determine terminal background color, not tinting."); + else + (void) pty_forward_set_background_color(forward, bg); + } else if (!isempty(arg_background)) (void) pty_forward_set_background_color(forward, arg_background); break;