Skip to content

Commit

Permalink
console: report detach message on demand
Browse files Browse the repository at this point in the history
When users pass -1 there's there won't be an escape sequence to exit the
console so no need to print a misleading info message about how to detach.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Nov 10, 2017
1 parent c83280b commit 686df16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lxc/console.c
Expand Up @@ -832,11 +832,14 @@ int lxc_console(struct lxc_container *c, int ttynum,
goto close_mainloop;
}

fprintf(stderr, "\n"
if (ts->escape >= 1) {
fprintf(stderr,
"\n"
"Connected to tty %1$d\n"
"Type <Ctrl+%2$c q> to exit the console, "
"<Ctrl+%2$c Ctrl+%2$c> to enter Ctrl+%2$c itself\n",
ttynum, 'a' + escape - 1);
}

if (istty) {
ret = lxc_setup_tios(stdinfd, &oldtios);
Expand Down

0 comments on commit 686df16

Please sign in to comment.