diff options
| author | Massimo Mund <masmu@users.noreply.github.com> | 2025-09-23 16:33:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-23 23:33:41 +0900 |
| commit | 148b0a94cdb88bc6e0ff36af1ab2b7bccd24e555 (patch) | |
| tree | de2a3f00dab9857ee4462d13a92b94e6a3cd0d95 | |
| parent | ca294109c37d5dfd3cc5d33026d58400fbfea34c (diff) | |
| download | fzf-148b0a94cdb88bc6e0ff36af1ab2b7bccd24e555.tar.gz | |
tui/light: consume full 7-byte CSI sequences to prevent leftover printing (#4528)
- Fix parsing in escSequence so 7-byte CSI forms (e.g. ESC [ 5 ; 10 ~) set *sz = 7 and the entire sequence is consumed.
- Prevents trailing bytes (like 10~) from remaining in the input buffer and being printed as stray characters.
| -rw-r--r-- | src/tui/light.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tui/light.go b/src/tui/light.go index ec93e67e..e971175b 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -479,6 +479,7 @@ func (r *LightRenderer) escSequence(sz *int) Event { return Event{Delete, 0, nil} } if len(r.buffer) == 7 && r.buffer[6] == '~' && r.buffer[4] == '1' { + *sz = 7 switch r.buffer[5] { case '0': return Event{AltShiftDelete, 0, nil} @@ -525,6 +526,7 @@ func (r *LightRenderer) escSequence(sz *int) Event { return Event{PageUp, 0, nil} } if len(r.buffer) == 7 && r.buffer[6] == '~' && r.buffer[4] == '1' { + *sz = 7 switch r.buffer[5] { case '0': return Event{AltShiftPageUp, 0, nil} @@ -569,6 +571,7 @@ func (r *LightRenderer) escSequence(sz *int) Event { return Event{PageDown, 0, nil} } if len(r.buffer) == 7 && r.buffer[6] == '~' && r.buffer[4] == '1' { + *sz = 7 switch r.buffer[5] { case '0': return Event{AltShiftPageDown, 0, nil} |
