]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
console: report detach message on demand
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 10 Nov 2017 18:51:57 +0000 (19:51 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 16 Nov 2017 21:49:07 +0000 (16:49 -0500)
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>
src/lxc/console.c

index 536136de6b319850ef862ea66d00d4ec14b55e5c..b439bc20cb6bf5e6a6104d38afea866066521ddb 100644 (file)
@@ -665,11 +665,13 @@ int lxc_console(struct lxc_container *c, int ttynum,
                goto err1;
        }
 
-       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);
+       }
 
        ret = setsid();
        if (ret)