diff --git a/man/tio.1 b/man/tio.1 index e5fe51e..628723b 100644 --- a/man/tio.1 +++ b/man/tio.1 @@ -71,9 +71,9 @@ In session, the following key sequences are intercepted as tio commands: .IP "\fBctrl-t ?" List available key commands .IP "\fBctrl-t c" +Show configuration (baudrate, databits, etc.) +.IP "\fBctrl-t l" Clear screen -.IP "\fBctrl-t i" -Show settings information (baudrate, databits, etc.) .IP "\fBctrl-t q" Quit .IP "\fBctrl-t s" diff --git a/src/include/tio/tty.h b/src/include/tio/tty.h index 4438199..c2fd813 100644 --- a/src/include/tio/tty.h +++ b/src/include/tio/tty.h @@ -24,7 +24,7 @@ #define KEY_QUESTION 0x3f #define KEY_C 0x63 -#define KEY_I 0x69 +#define KEY_L 0x6C #define KEY_Q 0x71 #define KEY_S 0x73 #define KEY_T 0x74 diff --git a/src/tty.c b/src/tty.c index e9354f4..c5d3ff5 100644 --- a/src/tty.c +++ b/src/tty.c @@ -81,19 +81,15 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c case KEY_QUESTION: tio_printf("Key commands:"); tio_printf(" ctrl-t ? List available key commands"); - tio_printf(" ctrl-t c Clear screen"); - tio_printf(" ctrl-t i Show settings information"); + tio_printf(" ctrl-t c Show configuration"); + tio_printf(" ctrl-t l Clear screen"); 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_C: - status = system("clear"); - *forward = false; - break; - case KEY_I: - tio_printf("Settings information:"); + tio_printf("Configuration:"); tio_printf(" TTY device: %s", option.tty_device); tio_printf(" Baudrate: %u", option.baudrate); tio_printf(" Databits: %d", option.databits); @@ -105,19 +101,23 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c tio_printf(" Log file: %s", option.log_filename); *forward = false; break; + case KEY_L: + status = system("clear"); + *forward = false; + break; case KEY_Q: /* Exit upon ctrl-t q sequence */ exit(EXIT_SUCCESS); - case KEY_T: - /* Send ctrl-t key code upon ctrl-t t sequence */ - *output_char = KEY_CTRL_T; - break; case KEY_S: /* Show tx/rx statistics upon ctrl-t s sequence */ tio_printf("Statistics:"); tio_printf(" Sent %lu bytes, received %lu bytes", tx_total, rx_total); *forward = false; break; + case KEY_T: + /* Send ctrl-t key code upon ctrl-t t sequence */ + *output_char = KEY_CTRL_T; + break; default: /* Ignore unknown ctrl-t escaped keys */ *forward = false;