#974669 regression: prompt disappears in rlwrap

Package:
libreadline8
Source:
readline
Description:
GNU readline and history libraries, run-time libraries
Submitter:
"Felix C. Stegerman"
Date:
2020-12-10 01:45:03 UTC
Severity:
normal
#974669#5
Date:
2020-11-13 15:33:50 UTC
From:
To:
With libreadline8=8.0-4 from testing:

  $ rlwrap -C test python3 -c 'while True: print("you said", input(">>> "))'
  >>> foo
  you said foo
  >>> bar
  you said bar
  >>> ^D

With libreadline8=8.1~rc2-2 from unstable:

  $ rlwrap -C test python3 -c 'while True: print("you said", input(">>> "))'
  foo
  you said foo
  bar
  you said bar
  >>>

The ">>> " prompt is initially shown each time, but then disappears
from the output afterwards.  If I input "baz" next, I get:

  foo
  you said foo
  bar
  you said bar
  baz
  you said baz
  >>>

- Felix

#974669#10
Date:
2020-12-10 01:42:30 UTC
From:
To:
Hi!

I've looked into this:

* readline 8.1 enables bracketed-paste by default;

* when bracketed-paste is enabled, rl_deprep_terminal() prints
  BRACK_PASTE_FINI ("\033[?2004l\r") to rl_outstream;

* this moves the cursor to the beginning of the line (instead of the
  position after the prompt), which causes the rlwrap prompt to be
  overwritten during rl_redisplay().

* thus, adding "set enable-bracketed-paste off" to my ~/.inputrc fixes
  the problem;

* THB I'm not entirely sure whether this is a bug in readline or in
  rlwrap, so I'll report it to both upstream projects.

- Felix