From c90223e4c8ada793411cd30279e8a60ab401ee36 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 6 Dec 2017 00:31:03 +0530 Subject: [PATCH] Report unknown CSI r sequences --- kitty/control-codes.h | 5 ----- kitty/parser.c | 9 +++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kitty/control-codes.h b/kitty/control-codes.h index 8acd797c0..23ee94ba1 100644 --- a/kitty/control-codes.h +++ b/kitty/control-codes.h @@ -221,11 +221,6 @@ // Soft reset #define DECSTR 'p' -// *Select top and bottom margins*: Selects margins, defining the -// scrolling region; parameters are top and bottom line. If called -// without any arguments, whole screen is used. -#define DECSTBM 'r' - // *Horizontal position adjust*: Same as :data:`CHA`. #define HPA '`' diff --git a/kitty/parser.c b/kitty/parser.c index 03ce1829c..6be325bfe 100644 --- a/kitty/parser.c +++ b/kitty/parser.c @@ -649,8 +649,13 @@ dispatch_csi(Screen *screen, PyObject DUMP_UNUSED *dump_callback) { CALL_CSI_HANDLER1P(save_cursor, 0, '?'); case RC: CALL_CSI_HANDLER1P(restore_cursor, 0, '?'); - case DECSTBM: - CALL_CSI_HANDLER2(screen_set_margins, 0, 0); + case 'r': + if (!start_modifier && !end_modifier) { + // DECSTBM + CALL_CSI_HANDLER2(screen_set_margins, 0, 0); + } + REPORT_ERROR("Unknown CSI r sequence with start and end modifiers: '%c' '%c'", start_modifier, end_modifier); + break; case DECSCUSR: CALL_CSI_HANDLER1M(screen_set_cursor, 1); case SU: