From 59a537f7dd08276d0115042ac89ccb2ae6b6cc3d Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Fri, 20 May 2016 20:10:12 +0200 Subject: [PATCH] Added 'ctrl-t ?' to list available commands --- man/tio.1 | 6 ++++-- src/include/tio/tty.h | 1 + src/tty.c | 9 +++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/man/tio.1 b/man/tio.1 index 38f1e84..4fd81ab 100644 --- a/man/tio.1 +++ b/man/tio.1 @@ -61,12 +61,14 @@ Display help. .PP .TP 16n In session, the following key sequences are intercepted as tio commands: +.IP "\fBctrl-t ?" +List available key commands .IP "\fBctrl-t i" -Show session settings information (baudrate, databits, etc.) +Show settings information (baudrate, databits, etc.) .IP "\fBctrl-t q" Quit .IP "\fBctrl-t s" -Show session statistics (total number of bytes transmitted/received) +Show statistics (total number of bytes transmitted/received) .IP "\fBctrl-t t" Send ctrl-t key code diff --git a/src/include/tio/tty.h b/src/include/tio/tty.h index 61c8487..0e4d651 100644 --- a/src/include/tio/tty.h +++ b/src/include/tio/tty.h @@ -22,6 +22,7 @@ #ifndef TTY_H #define TTY_H +#define KEY_QUESTION 0x3f #define KEY_I 0x69 #define KEY_Q 0x71 #define KEY_S 0x73 diff --git a/src/tty.c b/src/tty.c index 8348914..63d8eed 100644 --- a/src/tty.c +++ b/src/tty.c @@ -69,6 +69,15 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c { switch (input_char) { + case KEY_QUESTION: + tio_printf("Key commands:"); + tio_printf(" ctrl-t ? List available key commands"); + tio_printf(" ctrl-t i Show settings information"); + tio_printf(" ctrl-t q Quit"); + tio_printf(" ctrl-t s Show statistics"); + tio_printf(" ctrl-t t Send ctrl-t key code"); + *forward = false; + break; case KEY_I: tio_printf("Settings information:"); tio_printf(" TTY device: %s", option.tty_device);