Is it just me or you guys also feels that bash prompt is buggy? Specially if you go into history [using up errors or ctrl+r] and try to edit the the command?
Very much depends on what your bash prompt is actually set to - if it contains escape codes and the locale is set incorrectly you can get weird results when editing a previous command.
What kind of issue are you seeing?
Like Imagine a very long command eg.
$ ffmpeg -i video.mkv -c:a copy -c:v copy video.mp4
Now if I go into the history and try to edit this command by deleting some words first few words will not delete at least visibly and when you press enter it will behave like normal prompt eg.
$ ffmpeg -i video ls
This will list directories. like a normal running ls command should. Although I later found that this only happen when specific PS1 is acting as prompt. So I should look into that.
What is the setting of locale, any environment variables that you have defined and the setting of PS1?
I helped a friend debug an issue with his prompt where deletions and edits to a command would look like they have messed up the actual command itself, but it was merely the display of the command that was incorrect - the characters were fine when executed.
The issue was that he was using “C” in many of his locale variables and his prompt included a unicode character (happy or sad face depending on whether the last command returned a 0 or not) and that unicode multi-byte char was causing a miscalculation in the length of the redrawn, edited command.
LANG=en_US.UTF-8
No, simple PS1 command with u@h:w$ and with some colors I forgot since I deleted that line now.
If it annoys you, try starship.
I’ve not used bash for years now but I would suspect whatever you have in your PS1 prompt is possibly not 100% correct, as people would have noticed if bash was ballsing up line editing; that stuff probably hasn’t changed for 20 years if it’s using readline, which I suspect it is.
Which terminal are you using?