[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Readline macro question
From: |
Koichi Murase |
Subject: |
Re: Readline macro question |
Date: |
Sat, 30 Jul 2022 08:28:38 +0900 |
2022年7月30日(土) 7:45 Robert E. Griffith <bobg@junga.com>:
> Is there a way to get readline to return from inside the
> rl_print_line_and_clear function?
No.
> If not, I think I can use a macro that invokes a shell function and then
> has a \C-m to tell readline to return. Is the only way to do that to
> bind -x the function to a keyseq and then use that keyseq in the macro?
Yes, AFAIK.
> Are the key bindings from the emacs/VI mode different from those added
> with bind in that they can not be removed or replaced? Is that why
> trying to remove or change the "TAB" binding did not work?
How did you try to remove or change the keybinding of TAB (\C-i, \t)?
TAB is actually an old compatible name, so you cannot use it in `bind
-r' or in double-quotes.
# remove the binding for TAB
bind -r '\C-i'
# or
bind -r '\t'
# change the binding for TAB
bind '"\C-i": "hello"'
# or
bind '"\t": "hello"'
# The following also works but is a deprecated form.
bind 'TAB: "hello"'
# You cannot use the following because it removes/changes the binding
# for the sequence `T + A + B'.
#bind -r TAB
#bind '"TAB": "hello"'
--
Koichi