We want to reuse lxc_console_cb_tty_stdin() in lxc_attach.c.
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
return 1;
}
- /* we want to exit the console with Ctrl+a q */
- if (c == ts->escape && !ts->saw_escape) {
- ts->saw_escape = 1;
- return 0;
- }
+ if (ts->escape != -1) {
+ /* we want to exit the console with Ctrl+a q */
+ if (c == ts->escape && !ts->saw_escape) {
+ ts->saw_escape = 1;
+ return 0;
+ }
- if (c == 'q' && ts->saw_escape)
- return 1;
+ if (c == 'q' && ts->saw_escape)
+ return 1;
+
+ ts->saw_escape = 0;
+ }
- ts->saw_escape = 0;
if (write(ts->masterfd, &c, 1) < 0) {
SYSERROR("failed to write");
return 1;