mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Added "ctrl-t c" key command to clear screen
This commit is contained in:
parent
e9db9ea0de
commit
b9a2f4a1be
3 changed files with 10 additions and 0 deletions
|
|
@ -70,6 +70,8 @@ Display help.
|
|||
In session, the following key sequences are intercepted as tio commands:
|
||||
.IP "\fBctrl-t ?"
|
||||
List available key commands
|
||||
.IP "\fBctrl-t c"
|
||||
Clear screen
|
||||
.IP "\fBctrl-t i"
|
||||
Show settings information (baudrate, databits, etc.)
|
||||
.IP "\fBctrl-t q"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#define TTY_H
|
||||
|
||||
#define KEY_QUESTION 0x3f
|
||||
#define KEY_C 0x63
|
||||
#define KEY_I 0x69
|
||||
#define KEY_Q 0x71
|
||||
#define KEY_S 0x73
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -63,6 +64,7 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
|
|||
{
|
||||
char unused_char;
|
||||
bool unused_bool;
|
||||
int __attribute__((unused)) status;
|
||||
|
||||
/* Ignore unused arguments */
|
||||
if (output_char == NULL)
|
||||
|
|
@ -79,12 +81,17 @@ 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 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(" TTY device: %s", option.tty_device);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue