Multi-line command history inconsistent behavior
When pressing up-arrow a previous command is displayed as expected, again pressing up-arrow the cursor moves to the beginning of the command line. It should display the next command in history. Third up-arrow displays the next command in history. This behavior repeats for each command in history. Down-arrow seems to work fine.
whilst this might not be what you are expecting, this is working as intended/designed.
pressing "up" when you are not at the beginning of an input line is intended to take you either up a line (when the input line wraps over multiple lines) or to the beginning of the top line. pressing "up" at the beginning of an input line will attempt to fetch the previous history entry. if this is successful your input cursor will be placed at the end of the line
the "down" arrow works "fine" because you're left at the end of the input line. if your cursor however has been moved somewhere other than the end of the input line, then your first "down" press will bring you to the end of the line
I do understand that the up key handing isn't what you expected, but I couldn't work out a sensible way to get it to work in the kind of manner you were suggesting and still have sensible multi-line editing working. leaving the cursor at the beginning of the line when stepping thru history would "solve" this issue, but also feel weird in use when you want to edit a previously used command. other possibilities involve complex algorithms that change the line editing behaviour depending on whether the user has tried to edit the line or not, and can also end up feeling "unnatural".
at some point I plan to add support for page up/down keys to move thru command history, which would not care about cursor position on the line
leaving the cursor at the beginning of the line when stepping thru history would "solve" this issue, but also feel weird in use when you want to edit a previously used command
Being able to continuously scroll up and down with the up & down keys through the command history unimpeded is preferable. If the "home" & "end" keys are working properly, perhaps they could be used to opt-in and/or opt-out of "command history mode" based on the current context (the cursor's current position, whether it be at the beginning, end, or middle of a line; the current keyboard mode, whether it be "command history mode" or "editing mode"; etc.).
As you mentioned, though, I'm not sure how complex the algorithms would be to implement, or whether or not folks would find using the "home" and "end" keys to influence the keyboard mode behavior to feel too unnatural. I can understand why you want to transfer the command history control keys from the up & down keys to the page up & page down keys.
Hi Steve, thanks for explaining the logic behind the design. All is well. Looking forward to '*KEY' implementation;)
@tonedef71 the recent Console8 2.2.x release contains support for moving thru command history using the page up and page down keys. the up and down arrows, when at the beginning or end of the command line respectively, maintain their behaviour of also stepping thru the history.
@leventp that release also includes the *hotkey command