> When you press Backspace to erase a character, what normally happens is that > three characters are sent to the terminal: backspace, space, and backspace. > ... > Is it possible that your terminal is receiving BS-space-BS and for whatever > reason, is ignoring/discarding the two BS characters, and therefore not > moving the cursor where it's supposed to be? That's the best guess I > have at the moment.
Thanks for that explanation. This seems really likely, as it explains the treatment of the other line editing commands. Ctl-a results in no cursor motion at all, while Ctl-u results in a number of spaces equal to the cursor position being printed. But both edit the line correctly. I assumed from the beginning that the problem was somewhere in the pipeline other than inside Bash, but I can't get around the fact that the problem consistently occurs with Bash 5 and not Bash 4. The Bash 5 is both the one that comes with Debian 10 and the alpha version I compiled myself yesterday. The Bash 4 is what came with Debian 9 - I run it side by side on the Debian 10 system with the Debian 10 Bash and one exhibits the problem and the other does not. Well, it turns out the 'script' program is not a reliable way to see what is being sent to the terminal. It does not report any control characters received even when the cursor moves correctly. Any ideas on how I could see the raw character stream sent to a terminal? Say, I wonder what intelligence Bash uses to decide how to move the cursor to the left in the absence of terminfo. -- Bryan Henderson San Jose, California