]> git.proxmox.com Git - lxc.git/blob - debian/patches/0012-console-report-detach-message-on-demand.patch
merge lxc-console improvements from stable branch
[lxc.git] / debian / patches / 0012-console-report-detach-message-on-demand.patch
1 From 1e47ecd9a9367e6cf166c872d3cec26eb4c77aba Mon Sep 17 00:00:00 2001
2 From: Christian Brauner <christian.brauner@ubuntu.com>
3 Date: Fri, 10 Nov 2017 19:51:57 +0100
4 Subject: [PATCH 12/13] console: report detach message on demand
5
6 When users pass -1 there's there won't be an escape sequence to exit the
7 console so no need to print a misleading info message about how to detach.
8
9 Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
10 ---
11 src/lxc/console.c | 5 ++++-
12 1 file changed, 4 insertions(+), 1 deletion(-)
13
14 diff --git a/src/lxc/console.c b/src/lxc/console.c
15 index e95f5c54..8f6203f0 100644
16 --- a/src/lxc/console.c
17 +++ b/src/lxc/console.c
18 @@ -730,11 +730,14 @@ int lxc_console(struct lxc_container *c, int ttynum,
19 goto close_mainloop;
20 }
21
22 - fprintf(stderr, "\n"
23 + if (ts->escape >= 1) {
24 + fprintf(stderr,
25 + "\n"
26 "Connected to tty %1$d\n"
27 "Type <Ctrl+%2$c q> to exit the console, "
28 "<Ctrl+%2$c Ctrl+%2$c> to enter Ctrl+%2$c itself\n",
29 ttynum, 'a' + escape - 1);
30 + }
31
32 if (istty) {
33 ret = lxc_setup_tios(stdinfd, &oldtios);
34 --
35 2.11.0
36