From: Lennart Poettering Date: Fri, 23 Feb 2024 11:30:19 +0000 (+0100) Subject: nspawn: hide ^] hint unless we are interactive mode X-Git-Tag: v256-rc1~732^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4679016f3cac2cd13c29612cd12ac358ec1bcef;p=thirdparty%2Fsystemd.git nspawn: hide ^] hint unless we are interactive mode The hotkey only works in interactive mode hence don't mislead users about it. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index cd398f2461f..1cb039ade4a 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -5991,10 +5991,12 @@ static int run(int argc, char *argv[]) { _cleanup_free_ char *u = NULL; (void) terminal_urlify_path(t, t, &u); - log_info("%s %sSpawning container %s on %s.%s\n" - "%s %sPress %sCtrl-]%s three times within 1s to kill container.%s", - special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal(), - special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal()); + log_info("%s %sSpawning container %s on %s.%s", + special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal()); + + if (arg_console_mode == CONSOLE_INTERACTIVE) + log_info("%s %sPress %sCtrl-]%s three times within 1s to kill container.%s", + special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal()); } assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, SIGRTMIN+18) >= 0);