nspawn: hide ^] hint unless we are interactive mode

The hotkey only works in interactive mode hence don't mislead users
about it.
This commit is contained in:
Lennart Poettering
2024-02-23 12:30:19 +01:00
parent 795ec90cda
commit b4679016f3

View File

@@ -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);