0

My question has been answered. The problem was simply due to my bad edits of .bashrc. It has been resolved by a re-edit of the PS1 character string as shown in this snippet:

new PS1 edits in .bashrc

Here is my original Q Recalling previous commands in bash using the up/down arrows often responds with confusing text e.g. mixes half of commands together. Here's an example where I'm trying to recall previous dpkg command (by up arrow):

enter image description here

If I then use backspace key it doesn't delete duplicate chars, resulting in this: enter image description here This mostly occurs after entering a number of long commands then trying to roll back to a prior command.

In case it's relevant, I am using a shorter prompt. See attached image showing my edits for PS1 in bashrc:

my edits for PS1 in bashrc

Here are a few more examples:

bad prompt response 1

bad prompt response 2

How can this be fixed?

ChrisJ
  • 1

1 Answers1

-1

First, your PS1 has non-printing characters that are not designated as such. Re-read man $SHELL, the PROMPTING section.

Second, see Bash history handling with multiple terminals

waltinator
  • 37,856