immudb
immudb copied to clipboard
immuclient history navigation breaks when we move the cursor
What happened
Navigating the history (arrow up, arrow down) works well as soon as we don't do anything else. If we move the cursor (arrow left), it will not be possible to move forward again.
What you expected to happen
History navigation should work well even if we move the cursor or modify a history entry. This is how it works in Linux shells, mysql client, etc.
How to reproduce it (as minimally and precisely as possible)
- Run a command
- arrow up
- arrow down
OK - but:
- Run a command
- arrow up
- arrow left
- arrow down
The last step does nothing.
I think this is not a bug, this is expected behavior on liner
(the library under the hood).
If you for example enter enter login
command, then logout
command. If you move the arrow up until login, and the move the arrow left (or right) is like you have "selected" that option (liner is not only about the history, also about the line autocompletion, so that is important here).
Once you have selected the line, if you move the arrow up or down, you are selecting from the history things that starts with the same text, for example, if you have login
in the prompt, and you move the arrow up, you will move to anything that starts with login, because if that is what you have in the prompt. If you delete characters until you only have log
and move the arrow down, then you will see the logout
history entry again.
TLDR; this is not a bug, this is expected behavior from the liner
autocompletion library.
Fixed.