summaryrefslogtreecommitdiff
path: root/escape.h
diff options
context:
space:
mode:
Diffstat (limited to 'escape.h')
-rw-r--r--escape.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/escape.h b/escape.h
index 8b5f0dd..d7c54a4 100644
--- a/escape.h
+++ b/escape.h
@@ -31,6 +31,8 @@ enum esc_state {
DECSC,
DECRC,
NORMAL,
+ //escape followed by an escape, has to be user generated
+ DOUBLE_ESC,
};
//global stdin -> pty ESC state
enum esc_state in_state = NORMAL;
@@ -54,6 +56,7 @@ enum esc_state update_esc_state(char * buff,unsigned int buff_len, enum esc_stat
case C1:
case DECSC:
case DECRC:
+ case DOUBLE_ESC:
//all the sequences that have ended don't have an end
//and default to normal
case NORMAL:
@@ -91,8 +94,12 @@ enum esc_state update_esc_state(char * buff,unsigned int buff_len, enum esc_stat
}
else if (c == '8') {
state = DECSC;
+ }
+ else if (c == 0x1B) {
+ state = DOUBLE_ESC;
//deformed escape sequence
- } else {
+ }
+ else {
state = NORMAL;
}
break;