Conversation
Terminals encode special keys (Home, End, F-keys, modified arrows) as CSI sequences -- ESC [ followed by parameter/intermediate bytes and a single final byte. A key without an explicit binding would otherwise have its trailing bytes self-inserted as stray characters. Add skip-csi-sequence, which drains the remainder of such a sequence so unrecognised keys do nothing. Bound to "\e[", it acts as the fallback for any CSI sequence no longer/exact binding claims (arrow keys etc. still take precedence via the dispatcher's longest-match). It is left unbound by default, matching GNU readline; enable it from inputrc with "\e[": skip-csi-sequence. Implements the remaining command from issue #5. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
==========================================
+ Coverage 32.54% 38.33% +5.79%
==========================================
Files 58 59 +1
Lines 9207 9516 +309
==========================================
+ Hits 2996 3648 +652
+ Misses 6173 5785 -388
- Partials 38 83 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Jun 1, 2026
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.
Implements the remaining command from #5:
skip-csi-sequence(the GNU readline command name; issue text had it transposed as "csi-skip-sequence").What it does
Terminals encode special keys (Home, End, function keys, modified arrows) as CSI sequences —
ESC [followed by parameter/intermediate bytes (0x20–0x3F) and a single final byte (0x40–0x7E). A key with no explicit binding would otherwise have its trailing bytes (15~,Z,1;5D, …) self-inserted as stray characters.skip-csi-sequencedrains the remainder of such a sequence so unrecognized keys do nothing. Bound to\e[, it's the fallback for any CSI sequence no longer/exact binding claims; the dispatcher's longest-match means arrow keys (\e[A) etc. still win.Note: it is not equivalent to zsh's
self-insert-unmeta(as the issue's parenthetical suggested) — that inserts a meta-stripped key, whereas this discards an unrecognized sequence.Scope
inputrc/bind.goalready carries// skip-csi-sequence (not bound)in every keymap). Enable via inputrc:"\e[": skip-csi-sequence.standardCommands.Testing
TestSkipCsiSequencecovers params+final, bare final byte, modified-arrow params, stops-at-final-while-keeping-following-keys, and the empty no-op. Full suite,go vet, andgolangci-lintclean.Wiki (separate repo) documents both
skip-csi-sequenceandbracketed-paste-beginin Keymaps & Commands.🤖 Generated with Claude Code