summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/parser.c20
-rw-r--r--src/parser.l20
2 files changed, 36 insertions, 4 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);
diff --git a/src/parser.l b/src/parser.l
index 4ac44d7..773aa95 100644
--- a/src/parser.l
+++ b/src/parser.l
@@ -430,7 +430,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);
@@ -451,7 +459,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);