From: Daan De Meyer Date: Wed, 15 Jan 2025 11:01:09 +0000 (+0100) Subject: sandbox: Make terminal background color cyan if on tty X-Git-Tag: v25~52^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15c0cf89c3088e9ee89fdbb672d531bb3462759a;p=thirdparty%2Fmkosi.git sandbox: Make terminal background color cyan if on tty Let's make the sandbox more recognizable by turning the terminal background cyan if on a tty. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 7ac87b324..a653a1900 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -3786,8 +3786,18 @@ def run_sandbox(args: Args, config: Config) -> None: if hr: env |= {"MKOSI_HOST_RELEASE": hr} + cmdline = [*args.cmdline] + + if sys.stdin.isatty() and config.find_binary("systemd-pty-forward"): + cmdline = [ + "systemd-pty-forward", + "--title=mkosi-sandbox", + "--background=48;2;12;51;51", # cyan + *cmdline, + ] + run( - args.cmdline, + cmdline, stdin=sys.stdin, stdout=sys.stdout, env=os.environ | env,