[Twisted-Python] Using twisted.conch.recvline

Abe Fettig abe at fettig.net
Thu Jun 2 00:44:47 EDT 2005

Jp Calderone wrote:

> If you hook all these pieces up right, the protocol class you give to
> ServerProtocol should end up receiving application-level data from your
> ssh server, and its terminal attribute will be hooked up to send bytes
> back.
> Note that this API may not be stable.
> There's an example of all this smeared across
> doc/conch/examples/demo_recvline.py and twisted/conch/manhole_ssh.py.

I've done this, and it's working in my example the same way as it does
in demo_recvline.py. It's a much nicer environment than my original:
backspace works, arrows work, you can scroll up and down through command
history. Yippee!

But there's a problem, both in my code and in demo_recvline.py: when you
get to the bottom of the terminal it doesn't scroll. All the lines just
get pasted over each other on the bottom line of the terminal. I'm
clueless about terminal programming: generally I just know that I can
dump a bunch of text and the terminal will scroll. But now it doesn't.
Can you help me fix this?

Once I get this all working, I'll post a modified simplesshserver.py for
the benefit of others who might want a working line editing and history
for their custom protocol.



More information about the Twisted-Python mailing list