From f48402f7edb49ccd85b388d26f2a901148a8fde6 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Fri, 17 Jun 2022 10:58:55 +0200 Subject: [PATCH] Add config support for hex-mode --- man/tio.1.in | 2 ++ src/configfile.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/man/tio.1.in b/man/tio.1.in index 048a5cd..cf72afb 100644 --- a/man/tio.1.in +++ b/man/tio.1.in @@ -257,6 +257,8 @@ Set timestamp format Map special characters on input or output .IP "\fBcolor" Colorize tio text using ANSI color code ranging from 0 to 255. +.IP "\fBhex-mode" +Enable hexadecimal mode .IP "\fBsocket" Set socket path (must include .BR unix: ). diff --git a/src/configfile.c b/src/configfile.c index 8327775..617b31d 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -154,7 +154,17 @@ static int data_handler(void *user, const char *section, const char *name, { option.local_echo = false; } - + } + else if (!strcmp(name, "hex-mode")) + { + if (!strcmp(value, "enable")) + { + option.hex_mode = true; + } + else if (!strcmp(value, "disable")) + { + option.hex_mode = false; + } } else if (!strcmp(name, "timestamp")) {