[Twisted-Python] Using twisted.conch.recvline

Abe Fettig abe at fettig.net
Thu Jun 2 10:04:40 EDT 2005

James Y Knight wrote:

> I know way too much about terminal programming, and can immediately 
> identify the problem as the use of "ESC E". Never ever use ESC E,  it's
> worthless. While I'm at it: never use ESC D, and really try not  to use
> ESC M either. They're all mostly unused and people who don't  care about
> correctness, only "working for unix termcap" don't bother  implementing
> them right. Use instead \r\n, \n, and ESC[A (not quite  the same thing,
> as it doesn't do a backwards scroll, but if you think  backwards
> scrolling is going to work, I've got this bridge to sell  you...).

Thanks, it worked! I changed the nextLine() method of
insults.ServerProtocol to use \r\n:

class PatchedServerProtocol(insults.ServerProtocol):
    def nextLine(self):
        self.cursorPos.x = 0
        self.cursorPos.y = min(self.cursorPos.y + 1, self.termSize.y - 1)
        self.transport.write('\r\n') # this is the only change

Is this something that should be fixed in insults? I can submit a patch
to the bug tracker.

> Anyhow, could you say which horribly broken terminal program you're 
> using? I like to keep track of these things. From what I can tell,  the
> authors of most of the terminal emulators out there must have  never
> even bothered to read the documentation for the terminals they  claim to
> emulate...

gnome-terminal 2.10



More information about the Twisted-Python mailing list