On Thu, Nov 17, 2022 at 02:03:10AM +1100, Chet Ramey wrote:
On 11/16/22 12:19 AM, Kevin Pulo wrote:
I noticed that in readline 8.0 and later, if there is no prompt and I
press Enter with an empty input line, readline does not output a
newline. Earlier versions of readline did output a newline in this
situation.
Yes, since the cursor is at position 0 on an empty line, the readline
redisplay suppresses the newline. This is the desired behavior when,
for instance, you have multiple input lines and the cursor has just
wrapped to the final line. Readline doesn't make a distinction between
cases here, so your example also has the final newline suppressed.
Was this change deliberate? If so, is there a way to get the old
behaviour back (and if not, could an option be added)? If the change
was not intentional, can it be considered a bug and the behaviour
reverted?
It's not a bug. It's a fix for this redisplay issue:
https://lists.gnu.org/archive/html/bug-readline/2018-09/msg00004.html
Got it, thanks for clarifying.
I definitely encounter this issue much more often than entering a line
which happens to be exactly as wide as the terminal.
I could see making an exception if there is only one input line. Let me
look at that.
Yes, I would prefer if the newline suppression logic could be tweaked
to handle this specific case.