Disable DEC Special Graphics at exit if vt100

If a vt100 terminal receives the Shift In character '\016' it will
enable the 7 bit DEC Special Graphics character set used for line drawing.

For most users this can happen due to line noise from the tty device and
will likely mess up your terminal even after tio exits.

To better handle this we want to make sure that tio disables this mode
by sending the Shift Out character '\017' at exit.

This mechanism will only activate if environment variable TERM assumes
value "vt100".
This commit is contained in:
Martin Lund 2024-04-27 17:32:45 +02:00
parent cd160250a6
commit f5f62ee02d
3 changed files with 17 additions and 0 deletions

View file

@ -118,6 +118,7 @@ struct option_t option =
.exclude_drivers = NULL,
.exclude_tids = NULL,
.hex_n_value = 0,
.vt100 = false,
};
void print_help(char *argv[])
@ -487,6 +488,13 @@ void options_parse(int argc, char *argv[])
option.color = -1;
}
// Check for vt100 terminal
char *term = getenv("TERM");
if ((term != NULL) && (!strcmp(term, "vt100")))
{
option.vt100 = true;
}
while (1)
{
static struct option long_options[] =