immudb icon indicating copy to clipboard operation
immudb copied to clipboard

immuclient history navigation breaks when we move the cursor

Open federico-razzoli opened this issue 3 years ago • 1 comments

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)

  1. Run a command
  2. arrow up
  3. arrow down

OK - but:

  1. Run a command
  2. arrow up
  3. arrow left
  4. arrow down

The last step does nothing.

federico-razzoli avatar May 28 '21 21:05 federico-razzoli

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.

jespino avatar Oct 16 '21 18:10 jespino

Fixed.

ostafen avatar Apr 15 '24 08:04 ostafen