Well first you should implement a telnet server. Ideally this would be at least not completely half-assed. I have some code that does this if you know C# and need example code. Unfortunately the forum seems to be stripping the link so:
http://64.132.255.11/~eiz/aetascs/trunk/UfxLib/Net/Telnet/TelnetClient.cs
Now, beyond this you should implement the TTYPE telnet option to specify what kind of terminal is being used. This is documented in
RFC 1091. A client should be able to return as many TTYPEs as are relevant for the terminal.
Some people like to implement their own custom, unregistered and undocumented telnet options, as well. If you're going to do this, make sure you're extra careful about picking an option number that nobody else has used for their own undocumented, unregistered telnet option.
(Comment added by eiz on Wed May 4 19:57:30 2005)BTW, the above code needs to be refactored -- ignore the charmode stuff and the buffering. It's nasty.