Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15980
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Bug: bind -u shell-backward-word does not unbind the binding |
| Date | 2020-02-27 14:19 -0500 |
| Message-ID | <mailman.1652.1582831202.2412.bug-bash@gnu.org> (permalink) |
| References | <87h7zcjgh4.fsf@delllaptop.lockywolf.net> <12afe346-32d0-8541-f927-b6c0bd684fe2@case.edu> |
On 2/27/20 8:40 AM, lockywolf@gmail.com wrote: > --text follows this line-- > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Description: > It is possible to bind shell-backward-word, but not possible to unbind. > > Bash Version: 5.0 > Patch Level: 16 > Release Status: release > > Repeat-By: > 1) bind '"\e\C-b": shell-backward-word' # make binding > 2) bind -P # to check that the binding appeared > 3) bind -u shell-backward-word # to unbind the binding > 4) bind -P # to check that unbinding didn't work > > Fix: > I don't know how to fix the problem. Well, it's maybe non-obvious. The binding string begins with ESC, which is by default the meta-prefix for emacs mode. That means you do the key binding in the `emacs-meta' keymap. The `-u' option to bind operates on the default keymap, which in emacs mode is `emacs'. If you add the `-m emacs-meta' option to your `bind -u' command, you'll get the results you want. It might be better if the underlying readline function descended into keymaps such as emacs-meta rather than operating on a single keymap, but it doesn't do that right now. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Back to gnu.bash.bug | Previous | Next | Find similar
Re: Bug: bind -u shell-backward-word does not unbind the binding Chet Ramey <chet.ramey@case.edu> - 2020-02-27 14:19 -0500
csiph-web