`systemd-run`, `run0`, `systemd-nspawn`, `systemd-vmspawn`:
-* `$SYSTEMD_TINT_BACKGROUND` – Takes a boolean. When false the automatic
- tinting of the background for containers, VMs, and interactive `systemd-run`
- and `run0` invocations is turned off. Note that this environment variable has
- no effect if the background color is explicitly selected via the relevant
- `--background=` switch of the tool.
+* `$SYSTEMD_TINT_BACKGROUND` – Takes a boolean. When false the automatic and
+ explicit tinting of the background (via `--background=`) for containers, VMs,
+ `systemd-pty-forward` and interactive `systemd-run` and `run0` invocations is
+ turned off.
* `$SYSTEMD_ADJUST_TERMINAL_TITLE` – Takes a boolean. When false the terminal
- window title will not be updated for interactive invocation of the mentioned
- tools.
+ window title will not be updated for interactive invocation of the tools
+ mentioned above.
`systemd-hostnamed`, `systemd-importd`, `systemd-localed`, `systemd-machined`,
`systemd-portabled`, `systemd-timedated`:
arg_console_width,
arg_console_height);
- if (!arg_background && shall_tint_background()) {
+ if (!arg_background) {
_cleanup_free_ char *bg = NULL;
r = terminal_tint_color(220 /* blue */, &bg);
if (strv_extend(&arg_property, "IgnoreSIGPIPE=no") < 0)
return log_oom();
- if (!arg_background && arg_stdio == ARG_STDIO_PTY && shall_tint_background()) {
+ if (!arg_background && arg_stdio == ARG_STDIO_PTY) {
double hue;
if (privileged_execution())
#include "hostname-setup.h"
#include "io-util.h"
#include "log.h"
+#include "pretty-print.h"
#include "ptyfwd.h"
#include "stat-util.h"
#include "string-util.h"
if (!f->background_color)
return 0;
+ if (!shall_tint_background())
+ return 0;
+
s = background_color_sequence(f);
if (!s)
return -ENOMEM;
if (!f->background_color)
return 0;
+ if (!shall_tint_background())
+ return 0;
+
if (!is_csi_background_reset_sequence(strempty(f->csi_sequence)))
return 0;
* shovelling. Hence, possibly send some initial ANSI sequences. But do so only if we are
* talking to an actual TTY. */
- if (f->background_color) {
+ if (f->background_color && shall_tint_background()) {
/* Erase the first line when we start */
f->out_buffer = background_color_sequence(f);
if (!f->out_buffer)
if (r < 0)
return log_error_errno(r, "Failed to create PTY forwarder: %m");
- if (!arg_background && shall_tint_background()) {
+ if (!arg_background) {
_cleanup_free_ char *bg = NULL;
r = terminal_tint_color(130 /* green */, &bg);