core/exec-invoke: propagate $COLORTERM and $NO_COLOR from pid1 as well

Follow-up for 19aff5f775
This commit is contained in:
Mike Yuan
2025-05-29 21:16:28 +02:00
parent 3235fae685
commit 8ffebaaf4d
+10
View File
@@ -4548,6 +4548,16 @@ static int setup_term_environment(const ExecContext *context, char ***env) {
if (r < 0)
return r;
FOREACH_STRING(i, "COLORTERM=", "NO_COLOR=") {
const char *s = strv_find_prefix(environ, i);
if (!s)
continue;
r = strv_env_replace_strdup(env, s);
if (r < 0)
return r;
}
return 1;
}
}