mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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:
parent
cd160250a6
commit
f5f62ee02d
3 changed files with 17 additions and 0 deletions
|
|
@ -1067,6 +1067,14 @@ void stdin_configure(void)
|
|||
void stdout_restore(void)
|
||||
{
|
||||
tcsetattr(STDOUT_FILENO, TCSANOW, &stdout_old);
|
||||
|
||||
// If terminal is vt100
|
||||
if (option.vt100)
|
||||
{
|
||||
// Disable DEC Special Graphics character set just in case it was randomly
|
||||
// enabled by noise from serial device.
|
||||
putchar('\017');
|
||||
}
|
||||
}
|
||||
|
||||
void stdout_configure(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue