Re-engineering of terminal emulator, phase 1.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 13 Oct 2004 11:50:16 +0000 (11:50 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 13 Oct 2004 11:50:16 +0000 (11:50 +0000)
commit365660096382ada66bee99e2d6794cbb85e60124
tree38a6d74d78f871e13aaa1e5574ca68e4169b62e9
parenta510ac14678344268b6d8c63e77934c5b5327228
Re-engineering of terminal emulator, phase 1.

The active terminal screen is no longer an array of `unsigned long'
encoding 16-bit Unicode plus 16 attribute bits. Now it's an array of
`termchar' structures, which currently have 32-bit Unicode and 32
attribute bits but which will probably expand further in future.

To prevent bloat of the memory footprint, I've introduced a mostly
RLE-like compression scheme for storing scrollback: each line is
compressed into a compact (but hard to modify) form when it moves
into the term->scrollback tree, and is temporarily decompressed when
the user wants to scroll back over it. My initial tests suggest that
this compression averages about 1/4 of the previous (32 bits per
character cell) data size in typical output, which means this is an
improvement even without counting the new ability to extend the
information stored in each character cell.

Another beneficial side effect is that the insane format in which
Unicode was passed to front ends through do_text() has now been
rendered sane.

Testing is incomplete; this _may_ still have instabilities. Windows
and Unix front ends both seem to work as far as I've looked, but I
haven't yet looked very hard. The Mac front end I've edited (it
seemed obvious how to change it) but I can't compile or test it.

As an immediate functional effect, the terminal emulator now
supports full 32-bit Unicode to whatever extent the host platform
allows it to. For example, if you output a 4-or-more-byte UTF-8
character in Unix pterm, it will not display it properly, but it
will correctly paste it back out in a UTF8_STRING selection. Windows
is more restricted, sadly.

git-svn-id: svn://svn.tartarus.org/sgt/putty@4609 cda61777-01e9-0310-a592-d414129be87e
mac/macterm.c
putty.h
terminal.c
terminal.h
unicode.c
unix/pterm.c
window.c