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.
This commit is contained in:
Lennart Poettering
2024-01-23 16:45:37 +01:00
parent 3ef072ee26
commit 8bf3891e8e
+9 -1
View File
@@ -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;