Closed nmeum closed 2 years ago
The easiest way to achieve this is by adding the following lines to your .inputrc
:
$if pass_through_TAB
TAB:rlwrap-direct-keypress # This is *wrong*! Use self-insert (see below)
$endif
... and then calling rlwrap -C pass_through_TAB <your_program>
I don't want to do this through .inputrc since I want other readline-based programs to support tab completions.
Other readline-based programs (unless they are called pass_through_TAB
) will then still support TAB completion.
That said, both when using your solution, or mine, any output produced by the underlying command in response to your
both of which will probably result in a garbled mess.
That said, both when using your solution, or mine, any output produced by the underlying command in response to your will be invisible until either […]
That is fine in my case (I am using rlwrap
with ed(1)
and want to be able to insert \t
in edited files). I will use your solution. I wasn't aware that the -C
option can be used in this way. Thanks for pointing this out to me.
The only problem with your solution seems to be that it is not possible to delete inserted \t
characters with backspace on my system (while this is possible with my patch). Any idea why this might be the case?
Yes, my bad. You should use self-insert
instead of rlwrap-direct-keypress
.
The difference:
rlwrap-direct-keypress
will send your keypress immediately to the underlying command. This can be useful e.g. if the command has a special key (say CTRL+G
) to interrupt processing without using the terminal driver to send a SIGINT
self-insert
just enters your keypress into the readline
edit buffer. This is what you want (and what your solution already does)Ah! Works as intended now, thanks again!
Hello,
I am using rlwrap 0.4.5 with a program where I don't need tab completion and primarily use rlwrap to have readline-like keybindings like Ctrl+A and Ctrl+E. However, even though I don't use tab completion it does not seem to be possible to insert a literal
\t
character when the program is started through rlwrap, i.e. pressing<Tab>
does nothing. I would like have<Tab>
insert a literal\t
instead.Would it be possible to add an option which allows having
<Tab>
insert a literal tab character? Maybe something along the following?Is there a better way to achieve this? I don't want to do this through
.inputrc
since I want other readline-based programs to support tab completions.