From 74a543b263a8090604a9085d801e0ef0919a4ac2 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 10 Apr 2017 01:05:40 +0200 Subject: [PATCH] 'ctrl-t b' to send serial break. --- man/tio.1 | 2 ++ src/include/tio/tty.h | 1 + src/tty.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/man/tio.1 b/man/tio.1 index 628723b..ce0fc70 100644 --- a/man/tio.1 +++ b/man/tio.1 @@ -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 b" +Send serial break (triggers SysRq on Linux, etc.) .IP "\fBctrl-t c" Show configuration (baudrate, databits, etc.) .IP "\fBctrl-t l" diff --git a/src/include/tio/tty.h b/src/include/tio/tty.h index c2fd813..9941604 100644 --- a/src/include/tio/tty.h +++ b/src/include/tio/tty.h @@ -23,6 +23,7 @@ #define TTY_H #define KEY_QUESTION 0x3f +#define KEY_B 0x62 #define KEY_C 0x63 #define KEY_L 0x6C #define KEY_Q 0x71 diff --git a/src/tty.c b/src/tty.c index c4d52b4..3324d76 100644 --- a/src/tty.c +++ b/src/tty.c @@ -76,6 +76,7 @@ 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 b Send break"); tio_printf(" ctrl-t c Show configuration"); tio_printf(" ctrl-t l Clear screen"); tio_printf(" ctrl-t q Quit"); @@ -83,6 +84,9 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c tio_printf(" ctrl-t t Send ctrl-t key code"); *forward = false; break; + case KEY_B: + tcsendbreak(fd, 0); + break; case KEY_C: tio_printf("Configuration:"); tio_printf(" TTY device: %s", option.tty_device);