Skip to content

Conversation

@SATYADAHAL
Copy link

Kitty keyboard escape sequences such as '\x1b[2u', '\x1b[3u', and related pop events could be processed when the keyboard mode stack was already empty. This resulted in an index underflow (usize::MAX) and an out-of-bounds access, causing a panic in the PTY reader thread.

This PR guards against excessive pops and resets the keyboard mode state to prevent stack underflow and crashes.

This Closes #1385

Kitty keyboard escape sequences such as '\x1b[2u', '\x1b[3u', and related
pop events could be processed when the keyboard mode stack was already
empty. This resulted in an index underflow (usize::MAX) and an
out-of-bounds access, causing a panic in the PTY reader thread.
Guard against excessive pops and reset keyboard mode state to prevent
stack underflow and crashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on Kitty keyboard pop sequence '\x1b[<2u (keyboard mode stack underflow)

2 participants