help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Readline macro question


From: Robert E. Griffith
Subject: Re: Readline macro question
Date: Fri, 29 Jul 2022 19:41:55 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

Thanks Koichi, that clears things up.

--BobG

On 7/29/22 19:28, Koichi Murase wrote:
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]