nspawn: always set TERM=dumb when running with a pipe

Otherwise, we will get unexpected OSC sequences.
This commit is contained in:
Yu Watanabe
2025-08-13 23:43:52 +09:00
parent f79f89c202
commit 92366b8fbc
+2 -2
View File
@@ -3551,7 +3551,7 @@ static int inner_child(
envp[n_env++] = strjoina("container=", arg_container_service_name);
/* Propagate $TERM & Co. unless we are invoked in pipe mode and stdin/stdout/stderr don't refer to a TTY */
if (arg_console_mode != CONSOLE_PIPE || on_tty()) {
if (arg_console_mode != CONSOLE_PIPE && !terminal_is_dumb())
FOREACH_STRING(v, "TERM=", "COLORTERM=", "NO_COLOR=") {
char *t = strv_find_prefix(environ, v);
if (!t)
@@ -3559,7 +3559,7 @@ static int inner_child(
envp[n_env++] = t;
}
} else
else
envp[n_env++] = (char*) "TERM=dumb";
if (home || !uid_is_valid(arg_uid) || arg_uid == 0)