]> rtime.felk.cvut.cz Git - sojka/sterm.git/commit
Ignore CPR ANSI control sequence in exit_on_escapeseq()
authorMichal Sojka <michal.sojka@cvut.cz>
Sat, 4 Jan 2020 16:43:02 +0000 (17:43 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Sat, 4 Jan 2020 16:43:02 +0000 (17:43 +0100)
commit0e336e0fa306b4e369fa69398769e63c8a37cb8a
treec18dd917e1d6b5fed5421742f615c4e8880939ea
parent42366f1a7f042c6f6e84a1e877a0dce664eb5a1a
Ignore CPR ANSI control sequence in exit_on_escapeseq()

In some cases (e.g. Debian's initramfs) the device sends DSR (Device
Status Report) ANSI control sequences as a response to pressing Enter.
Some terminals (e.g. gnome terminal) respond to this by CPR (Cursor
Position Response) sequence, which appears as typed from keyboard. See
https://en.wikipedia.org/wiki/ANSI_escape_code#Terminal_output_sequences.

This complicates exiting sterm, because the exit escape sequence \n~.
must by typed very quickly (actually copy&pasted) so that CPR doesn't
appear between \n and ~..

This commit causes the CPR sequence to be ignored when detecting exit
sequence.

Fixes #2.
sterm.c