Autodetecting ANSI -- possible method?

From: Gary Barnett (gbarnett@polarnet.com)
Date: 01/30/97


I did a bit of poking around and determined the following:

PCBoard uses the <ESC>[6n test to determine if the remote machine can
support ANSI.

A bit more digging returned the following info. 

Query Cursor Position   <ESC>[6n
(sent by the mud)

Report Cursor Position <ESC>[{row},{col}R
(reply to query by the client if it understood the query)

Here's where I found the info on the codes:
 http://www.graphcomp.com/info/specs/ansi_col.html#top

So it would seem that you just send the sequence and set a flag.

After a timeout period (a few seconds, or the first keypress sent by the other end
that wasn't the code) you'd just give them the ascii logon screen. (this would seem
to be a good time to do an ident lookup as well.. might as well get two things done
during the same wait)

If you did receive a response of the form <ESC>[<anything>R
then give them the ANSI logon screen. (the anything is to support as many buggy
implementations as possible *grin*)

After they give you their name, you can check their color preferences and override
the detection.

This way a person with ANSI would get it by default, yet still
have the ability to turn it off. (maybe defaulting new players to ascii after
the opening screen isn't a bad idea.. they might have a telnet client that
behaves contrary to expectations)

I have a couple questions:

1) What percentage of the existing mud clients, and telnet clients
would correctly support this?

2) Can you see any reason (in Circle) that this type of negotiation would
fail? (i.e. linemode)

I'm going to try stuffing this in a stock copy .. see what happens.. any input
would be appreciated.

If/when I find that this idea is worth more than the bits possibly wasted by it's
transmittal I'll post the code :-)

--Mallory

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST