fix(console): backspace deletes char not word in emacs keymap (#2209)#2251
Open
Moriz82 wants to merge 1 commit intoBishopFox:masterfrom
Open
fix(console): backspace deletes char not word in emacs keymap (#2209)#2251Moriz82 wants to merge 1 commit intoBishopFox:masterfrom
Moriz82 wants to merge 1 commit intoBishopFox:masterfrom
Conversation
…Fox#2209) emacsKeys bound \C-h (ASCII 8, Backspace on some Linux terminals) to backward-kill-word, shadowing the correct DefaultBinds() entry (backward-delete-char). Readline convention: \C-h is single-char delete, \M-\C-h is word-kill. Remove the bad \C-h entry. DefaultBinds() handles it correctly, and Meta-Backspace still binds to backward-kill-word via \M-\C-h. Fixes BishopFox#2209 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
These edits will need to be in https://github.com/moloch--/readline the |
Contributor
Author
|
Thanks for the pointer, makes sense, I missed that vendor/ is generated. Opened a PR at https://github.com/moloch--/readline/pull/1 with the same fix and will cross-reference it here. |
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.
Bug
In the sliver console, pressing Backspace deletes the whole previous word. Type
beaconss, hit Backspace, everything disappears instead of just the lasts. Reported on Kali, but it hits any Linux terminal that sends\C-h(0x08) on Backspace.Cause
vendor/github.com/reeflective/readline/internal/keymap/emacs.gohas a tableemacsKeyswith a bad entry:That line shadows the correct
DefaultBinds()entry (\C-h→backward-delete-char). GNU readline convention:\C-his single-char delete,\M-\C-his word-kill. The override got it backwards.Fix
Delete the one bad line.
DefaultBinds()already has the right binding, and\M-\C-h(Meta-Backspace) still does word-kill.var emacsKeys = map[string]inputrc.Bind{ unescape(`\C-D`): {Action: "end-of-file"}, - unescape(`\C-h`): {Action: "backward-kill-word"}, unescape(`\C-N`): {Action: "down-line-or-history"},Tested
Built on a Kali arm64 VM (6.18). Master deletes the whole word; patched binary deletes one char. Meta-Backspace still kills the word like it should.
Change lives in
vendor/per the "vendor changes in a distinct commit" rule.Fixes #2209