aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-30 19:42:46 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-30 19:42:46 +0000
commit8acc3b891dabf5ba96b71771c77061769c3e29b8 (patch)
treefc302648c3e7f3d10a9faa50bef0049b9426e0c9 /vt.c
parentrender: don't pass a struct buffer when all we need is a cairo_t (diff)
vt: remove almost all abort() calls
Replace with generic error log messages that simply says the ESC/CSI/OSC sequence is unhandled. This can mean either invalid or unimplemented, depending on the context.
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/vt.c b/vt.c
index 0867d54f..cfb31884 100644
--- a/vt.c
+++ b/vt.c
@@ -12,6 +12,8 @@
#include "grid.h"
#include "osc.h"
+#define UNHANDLED() LOG_ERR("unhandled: %s", esc_as_string(term, final))
+
/* https://vt100.net/emu/dec_ansi_parser */
enum state {
@@ -613,8 +615,7 @@ esc_dispatch(struct terminal *term, uint8_t final)
case '+': term->charset[3] = CHARSET_ASCII; break;
default:
- LOG_ERR("%s: invalid charset identifier", esc_as_string(term, final));
- abort();
+ UNHANDLED();
break;
}
break;
@@ -658,8 +659,7 @@ esc_dispatch(struct terminal *term, uint8_t final)
case '+': term->charset[3] = CHARSET_GRAPHIC; break;
default:
- LOG_ERR("%s: invalid charset identifier", esc_as_string(term, final));
- abort();
+ UNHANDLED();
break;
}
break;
@@ -674,8 +674,7 @@ esc_dispatch(struct terminal *term, uint8_t final)
break;
default:
- LOG_ERR("unimplemented: ESC: %s", esc_as_string(term, final));
- abort();
+ UNHANDLED();
break;
}
}
@@ -888,10 +887,8 @@ action(struct terminal *term, enum action _action, uint8_t c)
term->vt.private[0] = c;
else if (term->vt.private[1] == 0)
term->vt.private[1] = c;
- else {
+ else
LOG_ERR("only two private/intermediate characters supported");
- abort();
- }
break;
case ACTION_ESC_DISPATCH: