I developped a python application that uses the cmd module to make an interactive command-line interface. This cmd module uses readline for command-line management: completion, history...
My issue is: on the computer I'm trying to use that app, when I type too long lines, it goes back to the beginning of the line and doesn't put a line feed. So I'm writing over the line itself. This makes browsing and editing commands in history a real pain. Although it works well on my development box.
I tried changing the shell from which I started python (from bash to sh), no difference, I tried to change the terminal I used (from Terminator to XTerm or UXTerm), no difference.
What would be your guess about where it comes from and how to solve this issue?
Edit: Here is a screenshot. I have found the cause of the bug, it comes from color characters that are not well treated when comparing to terminal line length, I guess.
In the first part of the screenshot (above the green line), I'm using a colored prompt (you can see the pink /), and when reaching the end of the line, I start writing over the prompt. If I keep writing, I can write one full line, overwriting the original first line completely and then it starts feeding new lines.
In the second part (below the green line), I'm writing until the end of line and the line feed appears at the right moment.
What could be the explanation behind this behaviour ? (It doesn't happen on every configuration, as I said.) How could I fix it ?