2 ms·
In my past experience, prompt/history corruption is quite often due to missing/incorrect use of \[ and \] around all the non-printing sequences (colours, format
by shabble 14y ago
In my past experience, prompt/history corruption is quite often due to missing/incorrect use of \[ and \] around all the non-printing sequences (colours, formatting, etc), which cause Bash to compute the length of the prompt incorrectly, and cause redrawing woes.
Worth double-checking, anyway. I've occasionally pondered some sort of prompt-lint/validator given the reams of dubious examples out there, and problems people face when customising their own.