Bug #98805 CTRL-p does not display previous command at command line
Submitted: 2 Mar 2020 17:15 Modified: 2 Mar 2020 19:36
Reporter: Glen Peterson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:8.0.19 OS:Debian (debian:stretch-slim docker container running on Ubuntu 18.04)
Assigned to: CPU Architecture:Any

[2 Mar 2020 17:15] Glen Peterson
Description:
The first time you hit CTRL-p (for previous command) at the MySQL command line, it does not show the previous command (it used to).  If you then hit ENTER it will actually execute the previous command, even though it was not shown.  This is a display issue.

How to repeat:
mysql> select(1);
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql> select(2);
+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.00 sec)

Now if you press up-arrow, you will get 'select(2);' which is correct.  But if you press CTRL-p, you just get a blank line.  Pressing CTRL-p a second time gives you 'select(1);' which is technically correct, but confusing.  Pressing CTRL-n gets you back to 'select(2);' which is correct.

Suggested fix:
CTRL-p should have the same functionality as pressing the up arrow.
[2 Mar 2020 17:56] Glen Peterson
Using GNOME Terminal 3.28.2
[2 Mar 2020 19:36] MySQL Verification Team
Thank you for the bug report. I couldn't repeat with most recent source build on Ubuntu 19.10.