Changed escape key from ^g to ^t

After renaming to "tio" it makes sense to change the escape key
accordingly. Hence, the new escape key is ^t.

Meaning, in session, its now ctrl-t + q to quit.
This commit is contained in:
Martin Lund 2016-05-07 14:31:24 +02:00
parent f6b69d244d
commit 72a287f189
5 changed files with 7 additions and 7 deletions

2
README
View file

@ -30,7 +30,7 @@
-v, --version Display version
-h, --help Display help
In session, press ctrl-g + q to quit.
In session, press ctrl-t + q to quit.
The only option which requires a bit of elaboration is the --no-autoconnect

View file

@ -61,7 +61,7 @@ Display help.
.SH "KEYS"
.TP
In session, press ctrl-g + q to quit.
In session, press ctrl-t + q to quit.
.SH "EXAMPLES"
.TP

View file

@ -22,7 +22,7 @@
#ifndef TTY_H
#define TTY_H
#define KEY_CTRL_G 0x07
#define KEY_CTRL_T 0x14
#define KEY_Q 0x71
void configure_stdout(void);

View file

@ -57,7 +57,7 @@ void print_options_help(char *argv[])
printf(" -v, --version Display version\n");
printf(" -h, --help Display help\n");
printf("\n");
printf("In session, press ctrl-g + q to quit.\n");
printf("In session, press ctrl-t + q to quit.\n");
printf("\n");
}

View file

@ -76,7 +76,7 @@ void wait_for_tty_device(void)
/* Exit upon ctrl-g + q sequence */
c_stdin[2] = c_stdin[1];
c_stdin[1] = c_stdin[0];
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_G))
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_T))
exit(EXIT_SUCCESS);
}
}
@ -223,13 +223,13 @@ int connect_tty(void)
{
/* Input from stdin ready */
status = read(STDIN_FILENO, &c_stdin[0], 1);
if ((c_stdin[0] != KEY_Q) && (c_stdin[0] != KEY_CTRL_G))
if ((c_stdin[0] != KEY_Q) && (c_stdin[0] != KEY_CTRL_T))
tainted = true;
/* Exit upon ctrl-g + q sequence */
c_stdin[2] = c_stdin[1];
c_stdin[1] = c_stdin[0];
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_G))
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_T))
exit(EXIT_SUCCESS);
/* Forward input to tty device */