Skip to content

feat(emacs): add skip-csi-sequence command#107

Merged
maxlandon merged 1 commit into
masterfrom
dev
Jun 1, 2026
Merged

feat(emacs): add skip-csi-sequence command#107
maxlandon merged 1 commit into
masterfrom
dev

Conversation

@maxlandon

Copy link
Copy Markdown
Member

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 (0x200x3F) and a single final byte (0x400x7E). A key with no explicit binding would otherwise have its trailing bytes (15~, Z, 1;5D, …) self-inserted as stray characters.

skip-csi-sequence drains 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

  • Unbound by default, matching GNU readline (inputrc/bind.go already carries // skip-csi-sequence (not bound) in every keymap). Enable via inputrc: "\e[": skip-csi-sequence.
  • No public API change — it's a keymap command, registered in standardCommands.
  • No default-behavior change.

Testing

TestSkipCsiSequence covers params+final, bare final byte, modified-arrow params, stops-at-final-while-keeping-following-keys, and the empty no-op. Full suite, go vet, and golangci-lint clean.

Wiki (separate repo) documents both skip-csi-sequence and bracketed-paste-begin in Keymaps & Commands.

🤖 Generated with Claude Code

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

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.33%. Comparing base (f79650a) to head (d4d431e).
⚠️ Report is 36 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maxlandon maxlandon merged commit aa06d08 into master Jun 1, 2026
11 checks passed
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.

1 participant