]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Re-engineering of terminal emulator, phase 1.
authorSimon Tatham <anakin@pobox.com>
Wed, 13 Oct 2004 11:50:16 +0000 (11:50 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 13 Oct 2004 11:50:16 +0000 (11:50 +0000)
commit709a94e5f27004e3933b022e1f01b96ddf854265
tree38a6d74d78f871e13aaa1e5574ca68e4169b62e9
parentf531e558f36f552a62061fe27c576156a871b7c1
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.

[originally from svn r4609]
mac/macterm.c
putty.h
terminal.c
terminal.h
unicode.c
unix/pterm.c
window.c