-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right-shifted input (or double prompt) after accepting a line in bracketed-paste-mode with readline-8.2 #168
Comments
On macOS 12 (Monterey) with Terminal/iTerm, I still experience the #166 bug ("rlwrap rewrites the input line right-shifted") even though I'm running rlwrap 0.46. So things definitely seem to be dodgy on the macOS front at the moment. |
What
... into your |
I think you're asking the OP, but if you'll excuse me I'll answer anyway:
readline installed as a dependency of rlwrap by
Yes, that stops the thing I'm seeing from happening. I remember having to apply that workaround in the past for #108, but I removed it after rlwrap 0.44 was released with a fix. |
Can (one of) you recompile with debugging enabled ( then
...type q ENTER, and then attach the resulting |
Now with debug. How I typed:
How it looked like after typing
(just a tiny discovery: with debug, it doesn't copy the prompt but puts spaces(?) there) |
Comparing your debug file with mine, I don't see any (relevant) differences. Still, your terminal gets messed up and mine doesn't Could you check out and compile branch
It might be the case that outputting If my hunch is right, the bug can also be avoided on OSX by using a terminal like |
The
|
Maybe interesting enough, neither |
There is an undocumented debug option that slows down and shows cursor movement. When I run
and then press q ENTER I see:
I suspect that the function
(The relevant code is at Can you try this out for me? |
Yes, sure, I have recorded a video how it looks like because it is not easy to explain 😄 Screen.Recording.2022-11-05.at.14.43.50.mov |
By the way, writing |
See #108. It turned out that (only) in bracketed-paste mode, However, it now turns out that on some systems the prompt gets reprinted by I will have to delve into the |
obfusk's comment in #108 maybe provides a clue:
The current problem (especially the fact that But, as Sherlock Holmes said: When you have eliminated the impossible, whatever remains, however improbable, must be the truth. I'll try and extend the terminal testing code at the end ot |
STOP PRESS: It turns out that I can reproduce this, after all, with readline-8.2 Even though I had compiled This is not OSX-specific after all, but rather dependent on the |
What happens is, rather, that if (terminal_prepped & TPX_BRACKPASTE)
{
fprintf (rl_outstream, BRACK_PASTE_FINI);
/* Since the last character in BRACK_PASTE_FINI is \r */
_rl_last_c_pos = 0; Those last two lines are not found in So now, when |
This should now be fixed in branch I essentially reverted the changes I made for #108 as People who want to use |
merged |
Thank you very much Hans. For the record I've submitted 0.46.1 to Homebrew in Homebrew/homebrew-core#114905 |
It works fine for me, thank you very much! 👍 |
First five commands of every command are repeated on enter, the length changes on the length of the `-S` argument passed to `rlwrap`. This seems to be related to changes for readline v0.8.1/v0.8.2, as discussed in a similar issue: hanslub42/rlwrap#168 With latest rlwrap release the issue is gone, fixes #127. Also note that the latest release is missing `v` prefix in the git tag, thus it's been removed from the URL of the release tarball.
When I use
rlwrap
with a command, which has a prompt, then I get very strange behaviour, when I type this:typing
q
and then press "Enter key":It changes the line with the prompt to
* * q
. When I use a different prompt:I mean it works, but this prompt copy is disturbing. When I use
with-readline
insteadrlwrap
it does not happen. It also happens just on my Mac OS X 13.0, not on Linux. Apple silicon and Intel-based behave slightly differently but have a similar error. On Intel it looks like that after enteringq
and pressing enter (instead of prompt, it copies the command):I have
rlwrap 0.46
(frombrew
or compiled manually makes no difference)Does anybody have an idea what could be wrong?
The text was updated successfully, but these errors were encountered: