When I use the Ctrl+p key binding (I use the default emacs key bindings) on my command line, it sometimes works as expected, showing the previous command that I've run. I'm using the bash shell on Ubuntu 18.04.
However, sometimes it glitches: it'll hold a part of the previous line in the command line. This does not affect the next command I run, but it's still bugging me. How can I fix this?
(I'm aware that this explanation doesn't make much sense, so here's a screenshot. I cannot backspace anymore on the last command (the
touch file line, for some reason.)
When I say "this does not affect the next command I run", here's what I mean:
Edit: my PS1 reads: