[...]
So, I am a little confused. Should I be sending these commands
as such:
buffer = ASCII.GetBytes("<ESC>[2j");
_clientStream.Write(buffer, 0, buffer.Length);
_clientStream.Flush();
That will only work if the other end has a terminal emulator that is
acting as a VT-series terminal (or at least as some terminal that uses the
same control codes). In other words, it might work but it's not something
you can count on.
You seem to be confusing the user terminal with telnet. Telnet is not
terminal emulation, and doesn't really have anything to do with terminal
emulation. You may want to layer some additional protocol above the
telnet protocol, to support things like character formatting and screen
clearing, but you should not expect the remote end to support those
things. A telnet client can be fully functional without having _any_ sort
of graphical control over the display.
Which is not to say that the telnet protocol doesn't support escape
codes. It does, and your server should be aware of these and handle them
properly. See the actual telnet specification for details:
http://www.faqs.org/rfcs/rfc854.html
Unless your server fully conforms to the specification, you don't actually
have a telnet server.
Pete