Closed nkh closed 2 years ago
I cannot reproduce this. When you say
rlwrap doesn't accept space as input;
... what exactly happens?
say that I clear the line, I type press "ABC
Let me know if I can run any test that can help
I still don't get it, sorry. ABCDE
is one word - what happens if you type AB CD E
?
sorry, I edited it and
if I type AB CD E: I get ABCDE, spaces are ignored
I cannot reproduce. This is what I see:
$ order=$(rlwrap -pYellow -S 'Your pizza? ' -H past_orders -P Margherita -o cat)
Your pizza? AB CD E # this remains on screen after pressing ENTER
$ echo $order
AB CD E
$ order=$(rlwrap -pYellow -S 'Your pizza? ' -H past_orders -P Margherita -o cat)
Your pizza? AB CD E #after pressing the up arrow once
what can I do to help find the problem?
First: make sure it is rlwrap
-specific:
xterm
, rxvt
)order=$(head -n 1) ; echo you ordered: $order
and then enter AB CD E
Then, only when this really turns out to be rlwrap-specific: re-compile rlwrap
with the --enable-debug
config option, call the compiled rlwrap
with the --debug
option and send me the resulting debug log /tmp/rlwrap.debug
test: I run in konsole + tmux, where the problem occurs, I tried with xterm + tmux and only xterm -> same problem test: order=$(head -n 1) ; echo you ordered: $order -> I get back my input, including the spaces
anything in my terminal setting/inputrc, ... that I can check?
I'll compile with debugging and come back with the information
Before you do that, one more test:
$ rlwrap cat
Does this "eat" the spaces as well? If not - that would suggest that this is the same problem as #145
It does eat spaces! I will re-read #145 and try to understand what the problem is
@hanslub42 I'm confused. I read #145 but I can't understand how it is related, apart from an incompatibility with Bash, as the ticket is about tty settings not being restored upon leaving rlwrap and my problem is while I am still in rlwrap.
Does rlwrap set the tty and start some sub shell where the settings are changed upon entry?
Do I need to to wrap the command I use in a script and set the tty properly? and in that case to what?
I need some time to investigate. rlwrap
manupulates its terminal settings (e.g. the ECHO
flag, using tcsetattr()
, and the terminal's bracketed paste settings, by outputting special codes). Usually, rlwrap
's input and output are the same terminal, so that it doesn't matter whether it manipulates that terminal via the input or the output filehandle. This has possibly made me complacent, manipulating the output filehandle even when it is not a tty. This would leave the terminal in a corrupt state when rlwrap
runs in a pileline, or a $(...)
context
That said, I know of no terminal setting that would make spaces unprintable. For a terminal, a space is just a character lijke Q
or 5
, so your problem is just as puzzling as when every letter would be printed except Q
That said, I know of no terminal setting that would make spaces unprintable.
If you bind SPACE
in your .inputrc
that could make the space key inoperable.
I do have:
Space: magic-space
in my inputrc, tried without and "rlwrap cat" works as expected, I hope this helps.
Ah, this explains the problem. Thanks for reporting back!
By the way, you can still enjoy your magic spaces by enclosing the relevant .inputrc
line in a $if... $endif
pair:
$if bash
SPACE: magic-space
$endif
running the man page example in a subshell order=$(rlwrap -pYellow -S 'Your pizza? ' -H past_orders -P Margherita -o cat)
I want a multi word "order": Margherita with extra everything
rlwrap doesn't accept space as input; I ran the same code with -c and was able to input multiple file names and a word but only one word
looked in the man page and googled around to no end