Tartarus CVS: putty: simon

tartarus-commits at lists.tartarus.org tartarus-commits at lists.tartarus.org
Wed Oct 13 12:50:19 BST 2004


CVS Root:       /home/cvs
Module:         putty
Changes by:     simon
Date:           Wed Oct 13 2004  12:50:19 BST

Log message:
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.

Modified files:
    .               : putty.h terminal.c terminal.h unicode.c window.c
    mac             : macterm.c
    unix            : pterm.c

Links:
http://cvs.tartarus.org//putty/putty.h.diff?r1=1.231&r2=1.232
http://cvs.tartarus.org//putty/terminal.c.diff?r1=1.167&r2=1.168
http://cvs.tartarus.org//putty/terminal.h.diff?r1=1.15&r2=1.16
http://cvs.tartarus.org//putty/unicode.c.diff?r1=1.36&r2=1.37
http://cvs.tartarus.org//putty/window.c.diff?r1=1.270&r2=1.271
http://cvs.tartarus.org//putty/mac/macterm.c.diff?r1=1.76&r2=1.77
http://cvs.tartarus.org//putty/unix/pterm.c.diff?r1=1.145&r2=1.146



More information about the tartarus-commits mailing list