Here are a couple of fixes I needed to use Nethack with the terminal emulator. First, the backspace character shouldn't erase the character at the current position.
Second--and I'm less sure about this--I had to make a carriage return move to the beginning of the current line and a linefeed move to the same column on the next line. This will work whenever the terminal receives \r\n for newlines but not when it only gets \n. My change seems to match what Nethack expects and what the ANSI terminal spec says. However, it breaks the test in ANSI.py and I don't know if it will break anything else.
Fix backspaces, carriage returns, and linefeeds in terminal emulator
This has fixed a problems I have had with curses application displaying incorrectly.
Accepted all but the following patch section:
if ch == '\n':
- self.crlf()
+ self.lf()
return
This caused unit tests to fail.
If there's anything more to do, please bring it to Github. https://github.com/pexpect/pexpect