summaryrefslogtreecommitdiffstats
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c
index b9fa3ed..89831fa 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -2591,7 +2591,15 @@ static void vt100_parser_handle_ed(VT100Screen *vt, char *buf, size_t len)
{
int params[VT100_PARSER_CSI_MAX_PARAMS] = { 0 }, nparams;
- vt100_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
+ /* this also gets called by handle_decsed, which will pass it something
+ * of the form \e[?1J instead of \e[1J */
+ buf += 2;
+ len -= 3;
+ if (*buf == '?') {
+ buf++;
+ len--;
+ }
+ vt100_parser_extract_csi_params(buf, len, params, &nparams);
switch (params[0]) {
case 0:
vt100_screen_clear_screen_forward(vt);
@@ -2612,7 +2620,15 @@ static void vt100_parser_handle_el(VT100Screen *vt, char *buf, size_t len)
{
int params[VT100_PARSER_CSI_MAX_PARAMS] = { 0 }, nparams;
- vt100_parser_extract_csi_params(buf + 2, len - 3, params, &nparams);
+ /* this also gets called by handle_decsel, which will pass it something
+ * of the form \e[?1J instead of \e[1J */
+ buf += 2;
+ len -= 3;
+ if (*buf == '?') {
+ buf++;
+ len--;
+ }
+ vt100_parser_extract_csi_params(buf, len, params, &nparams);
switch (params[0]) {
case 0:
vt100_screen_kill_line_forward(vt);