fix: support application cursor mode (DECCKM) for arrow keys#81
Merged
Conversation
Arrow keys now correctly send SS3 sequences (ESC O A/B/C/D) when application cursor mode is enabled (DEC mode 1), and CSI sequences (ESC [ A/B/C/D) when in normal mode. This fixes arrow key navigation in applications like htop that enable application cursor mode. Changes: - Rewrote Key enum to match Ghostty's internal values (was using USB HID codes) - Arrow keys now go through the Ghostty encoder instead of fast path - Sync encoder CURSOR_KEY_APPLICATION option with terminal mode 1 state - Add getModeCallback to InputHandler for querying terminal mode state - Add tests for both normal and application cursor modes The Key enum change also fixes the encoder for all special keys (F-keys, navigation keys, etc.) which were previously producing incorrect or empty output due to the enum value mismatch.
3210ee4 to
e6aa575
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #79