bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Behaviour change in 8.0 with empty input and no prompt


From: Kevin Pulo
Subject: Behaviour change in 8.0 with empty input and no prompt
Date: Wed, 16 Nov 2022 16:19:08 +1100

Apologies if this has already been discussed; I tried searching the
mailing list, but came up empty.

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.

The change is easily reproduced by pressing Enter a few times when
running the examples/rlbasic.c program.  In earlier versions, two
newlines are output for each Enter (one to move off the actual input
line itself, and one where rlbasic.c echos back the (empty) input
line).  In 8.0 and later, only one newline is output for each Enter
(where rlbasic echos back the empty input line).  Adjusting the
program to have a prompt (even if merely " ") gives consistent
behaviour between pre- and post-8.0.  I'm running Ubuntu Linux 22.04
x86_64, and building readline with just ./configure && make.  The
system compiler is gcc 11.3 (stock for Ubuntu 22.04).

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?

The impact is that with the new behaviour, it is no longer possible to
get empty lines ("vertical whitespace") on the terminal, in programs
that deliberately don't set a prompt.  In previous readline versions
this was trivial to do just by pressing Enter with empty input.

GNU bc is one such program (and where I first noticed this problem).
I sometimes use it as a quick "scratchpad" calculator.  After doing a
group of calculations, I press Enter a few times to get some blank
lines, before starting another group of (related) calculations.  With
the new behaviour, it's no longer possible to get the blank lines,
which means that all the calculations end up in a single "wall of
numbers" that's very difficult to navigate visually.

I note that this method of hitting Enter a few times to get some
"vertical whitespace" works fine (and is reasonably common practice, I
believe) in bash and other similar programs that take interactive
input with a prompt.  I find it strange and inconsistent to not be
able to do the same thing when there's no prompt.

Thanks,
Kev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]