This patch adds ANSI.SYS, SCO Xenix 2.3.2 and a general ANSI emulation.

The SCO Xenix is a well defined but rather old style emulation similar
in many respects to the ANSI.SYS emulation but a bit nicer. The later
SCO Unix variants are far more uncertain as they cover may versions of
SCO Unix where the emulation was changed to maintain or provide minimal
compatibility with other systems.

In the SCO Xenix emulation I have assumed the mapchan(1) facility has
been used to set the default character set to the putty line codepage. So
if your application assumes the mapchan process hasn't been run you will
need to set the line charset to CP437. The ANSI.SYS emulation forces CP437.

echo -e '\e[4040"p'   # Set normal PuTTY (xterm) mode.
echo -e '\e[4041"p'   # Set modern Ansi mode, all available non VT sequences.
echo -e '\e[4042"p'   # Set ANSI.SYS emulation
echo -e '\e[4043"p'   # Set SCO Xenix

echo -e '\e[4030"p'   # Set pure VT52 mode
echo -e '\e[4031"p'   # Set pure VT220+ mode

These and all the compatibility stuff can be turned off using the compile
option DISABLE_COMPAT. Note, CSI 4030"p turns off _nearly_ all the CSI
sequences, the exception being ones that begin "ESC [ 404".
The SCO emulation overrides the configured function key definitions.

The SCO Xenix emulation does not have the reverse or graphic attribute
variables. However, I do have full details if these are needed.

In ANSI.SYS mode CSI-J homes cursor.

Some cleanups to the emulation switching.
Adding better support for Windows MBCS (codepages)

Adding better support for some 国家标准 character sets. (ie Chinese standard
character sets), Japanese, Korean and Thai.  Including the Shift-JIS variants.

The characters are displayed at the expected widths.

This does NOT need a specific font as long as the unicode system can find the
requsite characters.

Note the change in the defaults; it is now recommended to explicitly
specify the line character set for DBCS systems.

Also added these Windows charsets to the list.

Unlike DBCS fonts this can be made to work for the Unix port as it only
requires Codepage to Unicode character and width tables.
DEBUG messages for tracing
Reconfigure PuTTY colour scheme from Unix host.

This is possibly related to: /wishlist/colour-scheme.html

These colour schemes are not stored in the PuTTY session file but are
instead "dynamically" configured from the host.

This script can send the required control sequences suitable for any
modern version of PuTTY or the Linux console.

It can calculate several standard forms and contains a default PuTTY
and XTerm mappings. In addition it can the colour scheme from a Windows
PuTTY registry dump, a Unix session file or something similar.
Add new interpretation for XTerm SGR 38/48

After actually seeing a copy of ITU T.416-199303 XTerm was modified
to be able to use the character ':' as the parameter seperator for 256
colour mode.

Unfortunatly, this documentation is still very unclear and the section
looks like it may have been written without fully understanding the
confused phrasing of ECMA-48.

As this is the only sequence that officially uses ':', is likely to be
the only one that ever uses that character and XTerm in effect does it
too. I've simply simply made ':' an alias of ';'.

My understanding of the combined documentation is that the sequences should
be of the form:

    CSI 48:5:1 ; 38:5:7 m

This is due to my reading the phrase "parameter sub-string" (in T.416)
as referring to a sub-string attached to a "parameter value". Not a
reference to the string version of the "parameter value" before it is
formally defined to be a decimal integer as it is in ECMA-48.

However, this is not really relevent as for compatibility reasons both the
semicolon seperated version will have to be supported.
Add XTerm/Konsole truecolour mode.

Phase 1, map the colours to the nearest XTerm 256 colour mode colour.
This is how XTerm does it.