From 3f52fd0763d212a91472a0e2271f6db9aab03f78 Mon Sep 17 00:00:00 2001 From: Ivan Vilata i Balaguer Date: Tue, 31 Jul 2012 16:01:27 +0200 Subject: [PATCH] Allow escape prefix to escape itself (Closes: #659011). Signed-off-by: Serge Hallyn Signed-off-by: Daniel Lezcano --- src/lxc/lxc_console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c index 5a1e45abd..d09c6882e 100644 --- a/src/lxc/lxc_console.c +++ b/src/lxc/lxc_console.c @@ -144,7 +144,7 @@ static int stdin_handler(int fd, void *data, struct lxc_epoll_descr *descr) } /* we want to exit the console with Ctrl+a q */ - if (c == my_args.escape) { + if (c == my_args.escape && !wait4q) { wait4q = !wait4q; return 0; } @@ -202,7 +202,9 @@ int main(int argc, char *argv[]) if (err) goto out; - fprintf(stderr, "\nType to exit the console\n", + fprintf(stderr, "\n\ +Type to exit the console, \ + to enter Ctrl+%1$c itself\n", 'a' + my_args.escape - 1); err = setsid(); -- 2.47.3