From ec96bf31dcd5e5b970c86306aa04c6ac51d87b46 Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Thu, 26 Mar 2026 18:09:07 +0000 Subject: [PATCH] fix: register CSI ^ as scroll down alias CSI Ps ^ is an alias for CSI Ps T (scroll down) added in upstream xterm.js commit da4243c. Without this handler, the sequence is silently ignored. Fixes #1 Co-authored-by: Ona --- inputhandler.go | 1 + inputhandler_csi_test.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/inputhandler.go b/inputhandler.go index 7ee78d6..d267848 100644 --- a/inputhandler.go +++ b/inputhandler.go @@ -205,6 +205,7 @@ func NewInputHandler( // CSI handlers — scroll p.RegisterCsiHandler(FunctionIdentifier{Final: 'S'}, h.scrollUp) p.RegisterCsiHandler(FunctionIdentifier{Final: 'T'}, h.scrollDown) + p.RegisterCsiHandler(FunctionIdentifier{Final: '^'}, h.scrollDown) p.RegisterCsiHandler(FunctionIdentifier{Intermediates: " ", Final: '@'}, h.scrollLeft) p.RegisterCsiHandler(FunctionIdentifier{Intermediates: " ", Final: 'A'}, h.scrollRight) p.RegisterCsiHandler(FunctionIdentifier{Intermediates: "'", Final: '}'}, h.insertColumns) diff --git a/inputhandler_csi_test.go b/inputhandler_csi_test.go index af29585..3ff4e8c 100644 --- a/inputhandler_csi_test.go +++ b/inputhandler_csi_test.go @@ -341,6 +341,16 @@ func TestScrollUpDown(t *testing.T) { Input: "AAA\x1b[2;1HBBB\x1b[1T", Expected: Expectation{Row0: "", Row1: "AAA"}, }, + { + Name: "SD_scroll_down_caret_alias", + Input: "AAA\x1b[2;1HBBB\x1b[1^", + Expected: Expectation{Row0: "", Row1: "AAA"}, + }, + { + Name: "SD_scroll_down_caret_2", + Input: "AAA\x1b[2;1HBBB\x1b[2^", + Expected: Expectation{Row0: "", Row1: ""}, + }, } for _, tc := range tests { t.Run(tc.Name, func(t *testing.T) {