core/exec-invoke: propagate $COLORTERM and $NO_COLOR from pid1 as well
Follow-up for 19aff5f775
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user