mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fixed handling of ctrl-t
Before, when exercising the quit key sequence (ctrl-t + q) the ctrl-t code (0x14) would be sent. This is now fixed so that it is not sent. However, in case it is needed to send ctrl-t to the device it is possible by simply repeating the ctrl-t. Meaning, ctrl-t + ctrl-t = ctrl-t sent to device.
This commit is contained in:
parent
ece9e7f918
commit
755ac53553
1 changed files with 9 additions and 4 deletions
|
|
@ -253,10 +253,15 @@ int connect_tty(void)
|
||||||
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_T))
|
if ((c_stdin[1] == KEY_Q) && (c_stdin[2] == KEY_CTRL_T))
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
|
/* Ignore ctrl-t except when repeated */
|
||||||
|
if ((c_stdin[0] != KEY_CTRL_T) ||
|
||||||
|
((c_stdin[0] == KEY_CTRL_T) && (c_stdin[1] == KEY_CTRL_T)))
|
||||||
|
{
|
||||||
/* Forward input to tty device */
|
/* Forward input to tty device */
|
||||||
status = write(fd, &c_stdin[0], 1);
|
status = write(fd, &c_stdin[0], 1);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
printf("Warning: Could not write to tty device");
|
printf("Warning: Could not write to tty device");
|
||||||
|
}
|
||||||
|
|
||||||
/* Write to log */
|
/* Write to log */
|
||||||
if (option.log)
|
if (option.log)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue