Added 'ctrl-t ?' to list available commands

This commit is contained in:
Martin Lund 2016-05-20 20:10:12 +02:00
parent 66d5cf5456
commit 59a537f7dd
3 changed files with 14 additions and 2 deletions

View file

@ -61,12 +61,14 @@ Display help.
.PP .PP
.TP 16n .TP 16n
In session, the following key sequences are intercepted as tio commands: In session, the following key sequences are intercepted as tio commands:
.IP "\fBctrl-t ?"
List available key commands
.IP "\fBctrl-t i" .IP "\fBctrl-t i"
Show session settings information (baudrate, databits, etc.) Show settings information (baudrate, databits, etc.)
.IP "\fBctrl-t q" .IP "\fBctrl-t q"
Quit Quit
.IP "\fBctrl-t s" .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" .IP "\fBctrl-t t"
Send ctrl-t key code Send ctrl-t key code

View file

@ -22,6 +22,7 @@
#ifndef TTY_H #ifndef TTY_H
#define TTY_H #define TTY_H
#define KEY_QUESTION 0x3f
#define KEY_I 0x69 #define KEY_I 0x69
#define KEY_Q 0x71 #define KEY_Q 0x71
#define KEY_S 0x73 #define KEY_S 0x73

View file

@ -69,6 +69,15 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
{ {
switch (input_char) 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: case KEY_I:
tio_printf("Settings information:"); tio_printf("Settings information:");
tio_printf(" TTY device: %s", option.tty_device); tio_printf(" TTY device: %s", option.tty_device);