[Top][All Lists]

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

Off-by-one error in history?

From: Adam Nielsen
Subject: Off-by-one error in history?
Date: Sun, 19 Jan 2020 11:29:46 +1000

Hi all,

I've just noticed an odd issue with the behaviour of the history and
I'm wondering whether this is an issue with readline?

Essentially if you use the up arrow key to move back in your history,
once you get to the beginning, the order becomes unpredictable.  For
example, if I run a command like `ftp` or `bc` and type this:


When I press the up arrow key, I can move through the history as
expected, first 5, then 4, 3, 2, and 1.  So far so good.

If I press the up key again, it moves past 1 and to a blank.  If I had
an incomplete line after '5' above, then this incomplete line appears
before '1' instead of the blank.

When I now press the down arrow key, expecting to move from the blank
down to 1, it instead moves from the blank down to 2, skipping 1
entirely.  If I continue pressing the down key, once I get to 5, I used
to be able to press the down key again to get to a blank (or the
incomplete line I was originally editing) but now it won't move past 5.

While on 5, if I press the up arrow to move back to 4, nothing happens.
I have to press it a second time to move it back to 4.

It looks like there might be some kind of off-by-one error happening?

I'm running readline 8.0 under Arch Linux, which looks[1] unmodified
from the 8.0 release except for the addition of the 001 patch.

Is anyone else able to reproduce this issue, or is it specific to Arch



reply via email to

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