Commit 014d5e1e by Christian Brauner

make escape sequence to exit tty optional

We want to reuse lxc_console_cb_tty_stdin() in lxc_attach.c. Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
parent 7e8aa95e
...@@ -641,6 +641,7 @@ static int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata, ...@@ -641,6 +641,7 @@ static int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
return 1; return 1;
} }
if (ts->escape != -1) {
/* we want to exit the console with Ctrl+a q */ /* we want to exit the console with Ctrl+a q */
if (c == ts->escape && !ts->saw_escape) { if (c == ts->escape && !ts->saw_escape) {
ts->saw_escape = 1; ts->saw_escape = 1;
...@@ -651,6 +652,8 @@ static int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata, ...@@ -651,6 +652,8 @@ static int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
return 1; return 1;
ts->saw_escape = 0; ts->saw_escape = 0;
}
if (write(ts->masterfd, &c, 1) < 0) { if (write(ts->masterfd, &c, 1) < 0) {
SYSERROR("failed to write"); SYSERROR("failed to write");
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment