the scrollback if you then leak away all the memory you saved!) One
of the leaks - by far the bigger of the two - was in my temporary
diagnostic function cc_check(), which is particularly embarrassing :-)
[originally from svn r4638]
was checking whether lattr == LATTR_NORM, where it should have been
checking (lattr & LATTR_MODE) to mask off LATTR_WRAPPED et al.
[originally from svn r4627]
XXX-REMOVE-BEFORE-RELEASE tag, since they're performance-intensive.
And now that I'm reasonably confident of remembering to remove them
before the next release, I feel less guilty about adding them willy-
nilly all over the place, so I've shoved in a couple more for now :-)
[originally from svn r4624]
array of each `termline' structure now contains optional additional
entries after the normal number of columns, which are used to chain
a linked list of combining characters off any primary termchar that
needs it. This means we support arbitrarily many combining
characters per cell (unlike xterm's hard limit of 2).
Cut and paste works correctly (selecting a character cell containing
multiple code points causes all those code points to be cut and
pasted). Display works by simply overlaying all the relevant
characters on top of one another; this is good enough for Unix
(xterm does the same thing), and mostly seems OK for Windows except
that the Windows Unicode fonts have a nasty habit of not containing
most of the combining characters and thus overlaying an
unknown-code-point box on your perfectly good base glyph.
I had no idea how to add support in the Mac do_text(), so I've
simply stuck in an assertion that will trigger the first time a
combining character is displayed, and hopefully this will bite
someone with the clue to fix it.
[originally from svn r4622]
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]
`all session data' modes, without completely mauling the performance, by
fflush()ing once per term_out(). If anyone complains I suppose we can
make this optional.
[originally from svn r4445]
scrollback and the terminal to the clipboard, rather than just the
content before the cursor. Should fix copyall-to-cursor.
[originally from svn r3929]
from_backend() interface, after having made all implementations safe against
being called with len==0 and possibly-NULL/undefined "data".
(This includes making misc.c:bufchain_add() more robust in this area.)
Assertion was originally added 2002-03-01; e.g., see plink.c:1.53 [r1571].
I believe this now shouldn't break anything.
This should hopefully make `ppk-empty-comment' finally GO AWAY. (Tested
with Unix PuTTY.)
[originally from svn r3500]
[r1571 == fdbd697801]
by the SCO SNF and SNB sequences, which seems to be what the SCO console does
(at least in the new mode documented for OpenServer 5.0.6).
[originally from svn r3286]
CSI = Ps c
CSI = Pn1 ; Pn2 C
CSI = Ps D
CSI = Ps F
CSI = Ps G
SGR 6
Patch derived from one supplied by Leonid Lisoskiy, with several fixes from me.
[originally from svn r3263]
screen'. Now it also disables the save-and-restore-cursor behaviour
of ESC[?1048h and ESC[?1049h, since these sequences seem to be
output by software trying to switch to the alternate screen, and it
looks very odd to have the cursor position restored to where it was
before `less' when the garbage `less' wrote all over the screen is
still around. The `traditional' ESC 7 and ESC 8 still function as
normal, on the basis that they aren't usually used in conjunction
with the alternate screen. I'm not sure whether this will be the
right decision; I'm prepared to change it back if a sufficiently
serious counterexample shows up.
[originally from svn r3222]
time. This gives rise to a whole bunch of spare warnings, one or two
of which might have been actual bugs; now all resolved.
[originally from svn r3134]
hazard. I considered removing it completely, but I can't rule out
the possibility of an OS that actually takes security of its
terminal devices seriously, and which might be able to make sensible
and safe use of this feature.
[originally from svn r3103]
of PuTTY (terminal, backend, logctx etc) take a `void *' handle
passed to them from the frontend, and used as a context for all
their callbacks. Most of these point at the frontend structure
itself (on platforms where this is meaningful), except that the
handle passed to the backend has always pointed at the terminal
because from_backend() was implemented in terminal.c. This has
finally bitten Unix PuTTY, because both backend and logctx have
been passing their respective and very different frontend handles to
logevent(), so I've fixed it.
from_backend() is now a function supplied by the _frontend_ itself,
in all cases, and the frontend handle passed to backends must be the
same as that passed to everything else. What was from_backend() in
terminal.c is now called term_data(), and the typical implementation
of from_backend() in a GUI frontend will just extract the terminal
handle from the frontend structure and delegate to that.
This appears to work on Unix and Windows, but has most likely broken
the Mac build.
[originally from svn r3100]
being able to be a PuTTY as well as a pterm. In the process I've
also moved icky things like actually reading from the pty fd and
printing the `terminated on signal' messages into pty.c where they
obviously should have been in the first place. Also there's been one
interesting repercussion in the terminal code: terminal.c's
from_backend now calls term_out() directly rather than expecting the
front end to call it afterwards. This has had the entertaining side
effect of fixing a Windows-specific bug whereby activity in a port
forwarding through a PuTTY with a blinking cursor caused the cursor
to blink to ON (!!!!). So, a surprisingly far-reaching checkin as it
turns out...
[originally from svn r3017]
malloc functions, which automatically cast to the same type they're
allocating the size of. Should prevent any future errors involving
mallocing the size of the wrong structure type, and will also make
life easier if we ever need to turn the PuTTY core code from real C
into C++-friendly C. I haven't touched the Mac frontend in this
checkin because I couldn't compile or test it.
[originally from svn r3014]
but PuTTY was running out of memory, which is both easy and fatal under Mac OS
at present. Having fixed that, I've re-instated the screen-clearing and
cursor-homing on DECCOLM, and added resetting the scroll region, since this
seems to help VTL's keypad diagram display correctly.
[originally from svn r3006]
Correct interactions with DECOM and DECSTBM not investigated.
Should fix bug "deccolm-cls", but I'll leave it open till I've checked the
interactions.
[originally from svn r3001]
a marker which defines everything before it as `permanent'
scrollback and everything after it as `temporary'; only temporary
scrollback lines are returned to the main screen when the window
height is increased. Screen clears mark the lines pushed into the
scrollback as permanent; so lines explicitly cleared off the screen
by ESC[2J are never returned to it by mistake. This patch also fixes
the incorrect state the primary screen is left in when the window is
resized while the alternate screen is active.
[originally from svn r2923]
clears, and also to temporarily push the primary screen contents
into the scrollback while the alternate screen is active and bring
it back afterwards.
[originally from svn r2910]
combining adjacent ones for the same region, and runs them all in do_paint.
I'm not sure it's entirely right, but it works on my Mac in every case I've
tested.
[originally from svn r2763]
these fiddly little changes are no longer bugs I introduced
recently, they're bugs that have been around all along and I've only
just smoked out by altering the ATTR_* definitions.
[originally from svn r2754]
Apparently I used to rely on the fact that the same `erase_char'
used to wipe parts of the screen was also a good value to use for
resetting line attributes. Should now be more robust against future
reorganisations of the ATTR_* bit fields.
[originally from svn r2740]
foreground colours, and ESC[100m through ESC[107m to set bright
background colours. Hence, so do we. Bright-foreground is
distinguishable from bold, and bright-background distinguishable
from blink, when it leaves terminal.c; the front end may then choose
to display them in the same way if it's configured to do so. This
change makes the xterm backend for Turbo Vision (!!!) work properly.
Untested on Mac.
[originally from svn r2734]