Граф коммитов

226 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 42801b7e9e Get rid of all the MSVC warnings.
[originally from svn r7086]
2007-01-09 18:24:07 +00:00
Jacob Nevins 4ae926fa8a Patch inspired by one from Daniel Silverstone in Debian bug #229232:
We now have an option where a remote window title query returns a well-formed
response containing the empty string. This should keep stop any server-side
application that was expecting a response from hanging, while not permitting
the response to be influenced by an attacker.

We also retain the ability to stay schtum. The existing checkbox has thus
grown into a set of radio buttons.

I've changed the default to the "empty string" response, even in the backward-
compatibility mode of loading old settings, which is a change in behaviour;
any users who want the old behaviour back will have to explicitly select it. I
think this is probably the Right Thing. (The only drawback I can think of is
that an attacker could still potentially use the relevant fixed strings for
mischief, but we already have other, similar reports.)

[originally from svn r7043]
2006-12-31 15:33:33 +00:00
Jacob Nevins 9c954238bd CSI 3 J now clears the scrollback, as in xterm.
[originally from svn r6847]
[this svn revision also touched putty-wishlist]
2006-09-05 22:08:00 +00:00
Simon Tatham 6104963b9b Er, ahem. Other half of r6788. :-/
[originally from svn r6791]
[r6788 == 09f86ce7ec]
2006-08-15 22:48:01 +00:00
Simon Tatham 09f86ce7ec Aha! At long last I've managed to reproduce the intermittent problem
I've been having with the cursor sometimes restoring to the wrong
place when screen(1) terminates. The offending sequence of escape
sequences goes ESC 7 (save cursor), ESC [?47h (switch to alternate
screen), ESC 7 (save cursor _again_), do some stuff, ESC 8 (restore
cursor), run screen session for a bit, ESC [?47l (return to main
screen), ESC 8 (restore cursor). The final ESC 8 is expected to
restore the cursor to where it was saved by the initial ESC 7.

Translation: the ESC 7 saved cursor state is part of the state we
must swap out when switching to the alternate screen. In other
words, we need to track _four_ cursor positions: active and saved,
on each of main and alternate screen. Previously we were tracking
only three.

[originally from svn r6788]
2006-08-15 12:45:21 +00:00
Jacob Nevins a2c060d638 Do not send raw mouse events in the middle of a selection operation, even if
we otherwise would (for instance, if Shift is released before the mouse button
being used for selection).

[originally from svn r6727]
[this svn revision also touched putty-wishlist]
2006-06-11 12:56:52 +00:00
Jacob Nevins 7958a63147 Sprinkle some header comments in various files in an attempt to explain what
they're for.

[originally from svn r6639]
2006-04-23 18:26:03 +00:00
Simon Tatham 8e368671cc Fix inadvertent O(N^2) loop within do_paint() which I just
discovered when profiling IPBT.

[originally from svn r6602]
2006-03-12 14:53:18 +00:00
Simon Tatham 18509f8422 Alain Guibert points out that ESC]P sequences were erroneously
accepting 'G' as a hex digit. (The _first_ digit of the sequence
intentionally goes up further than F, but the remaining ones
shouldn't have.)

[originally from svn r6581]
2006-02-20 19:54:17 +00:00
Jacob Nevins dd73d2a836 Fix `restart-reset-terminal': terminal now restored to a sensible state when
reusing a window to restart a session.

[originally from svn r6577]
[this svn revision also touched putty-wishlist]
2006-02-19 14:59:48 +00:00
Jacob Nevins 9432d92b91 At last, a fix for `large-clipboard-crash'.
A growable buffer was only being grown for actual text, not for newlines or
trailing NULs. A large run of empty lines could lead to newlines overflowing
the buffer (> 100 should be enough to guarantee this on all platforms, after
the initial 5k size of the buffer).

Also fix some valgrind in the same area (was probably harmless), and a memory
leak introduced by the RTF attribute pasting.

[originally from svn r6570]
[this svn revision also touched putty-wishlist]
2006-02-19 01:37:45 +00:00
Jacob Nevins 9496269c6e Pointer type correction in term_clrsb().
(Harmless, as it happens.)

[originally from svn r6568]
2006-02-18 22:30:10 +00:00
Owen Dunn d526e3bb33 Preserve more attributes of text copied as RTF. Thanks to Stephen Balousek.
[originally from svn r6555]
2006-02-13 22:18:17 +00:00
Owen Dunn ad05f78303 Fix zero-rows-cols-crash
[originally from svn r6515]
2006-01-10 20:02:22 +00:00
Simon Tatham 0a4b6612fb A few small changes to make the PuTTY source base more usable as a
basis for other terminal-involving applications: a stub
implementation of the printing interface, an additional function in
notiming.c, and also I've renamed the front-end function beep() to
do_beep() so as not to clash with beep() in lib[n]curses.

[originally from svn r6479]
2005-12-09 20:04:19 +00:00
Jacob Nevins f164b330ae When a userpass interaction has finished, make sure the 'prompts' structure
is safe for re-use.

[originally from svn r6444]
2005-11-02 23:15:43 +00:00
Jacob Nevins 8719f92c14 Revamp SSH authentication code so that user interaction is more
abstracted out; replace loops structured around a single interaction
per loop with less tortuous code (fixes: `ki-multiprompt-crash',
`ssh1-bad-passphrase-crash'; makes `ssh2-password-expiry' and
`proxy-password-prompt' easier).

The new interaction abstraction has a lot of fields that are unused in
the current code (things like window captions); this is groundwork for
`gui-auth'. However, ssh.c still writes directly to stderr; that may
want to be fixed.

In the GUI apps, user interaction is moved to terminal.c. This should
make it easier to fix things like UTF-8 username entry, although I
haven't attempted to do so. Also, control character filtering can be
tailored to be appropriate for individual front-ends; so far I don't
promise anything other than not having made it any worse.

I've tried to test this fairly exhaustively (although Mac stuff is
untested, as usual). It all seems to basically work, but I bet there
are new bugs. (One I know about is that you can no longer make the
PuTTY window go away with a ^D at the password prompt; this should be
fixed.)

[originally from svn r6437]
[this svn revision also touched putty-wishlist]
2005-10-30 20:24:09 +00:00
Simon Tatham 309ddb5cad Failed to call set_erase_char() after processing SCO colour sequences.
[originally from svn r6379]
2005-10-08 09:09:50 +00:00
Simon Tatham 9d3ab46800 UTF-8 processing was discarding a valid character which interrupted
an otherwise legal sequence, if that valid character was the last
thing in a term_out() run. Spotted by Egmont Koblinger.

[originally from svn r6373]
2005-10-03 11:38:30 +00:00
Jacob Nevins fb581ac625 First crack at `terminal-modes' in SSH. PuTTY now sends ERASE by default,
Unix Plink sends everything sensible it can find, and it's fully configurable
from the GUI.

I'm not entirely sure about the precise set of modes that Unix Plink should
look at; informed tweaks are welcome.

Also the Mac bits are guesses (but trivial).

[originally from svn r5653]
[this svn revision also touched putty-wishlist]
2005-04-21 13:57:08 +00:00
Jacob Nevins 3d012d9bd0 Pull out parsing of ^C style strings from the terminal answerback code to
its own function, since I'll be wanting it for `terminal-modes'.

[originally from svn r5646]
2005-04-19 18:58:29 +00:00
Jacob Nevins cf721acc1f #ifdef out expensive combining-character/scrollback diagnostics (for now).
[originally from svn r5589]
2005-04-01 13:25:13 +00:00
Jacob Nevins 9049f43955 `wcwidth-upgrade': upgrade to latest wcwidth.c from Markus Kuhn
<http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c>.
This is identified both internally and in HTTP headers as 2003-05-20,
for Unicode 4.0.

Only changes from upstream are to make mk_wcwidth_cjk() non-static and to
#include "putty.h" for prototypes.

The status of some code points has changed; see the wishlist item. We've
had some feedback from the CJK and Arabic communities that upgrading is
probably the right thing to do.

[originally from svn r5547]
[this svn revision also touched putty-wishlist]
2005-03-23 20:04:08 +00:00
Jacob Nevins faf59c78be Add an option to use wcwidth_cjk() instead of wcwidth(), as several people
have asked for it.

[originally from svn r5542]
2005-03-22 23:20:23 +00:00
Jacob Nevins 5aa719d16e Consistently use a single notation to refer to SSH protocol versions, as
discussed. Use Barrett and Silverman's convention of "SSH-1" for SSH protocol
version 1 and "SSH-2" for protocol 2 ("SSH1"/"SSH2" refer to ssh.com
implementations in this scheme). <http://www.snailbook.com/terms.html>

[originally from svn r5480]
2005-03-10 16:36:05 +00:00
Jacob Nevins d860adb55d Fix sense of test in previous checkin :)
[originally from svn r5448]
2005-03-06 15:00:45 +00:00
Simon Tatham be8acb5615 I'm sick and tired of the persistent reports of lineptr() failing
its `line != NULL' assertion, so I've replaced the assertion with a
call to fatalbox() giving oodles of information. I may still not be
able to reproduce it, but at least next time it happens we should
see a decent amount of debugging data!

[originally from svn r5447]
2005-03-06 14:48:22 +00:00
Ben Harris 3c44ce243f Correct some comments based on feedback from Thomas Dickey.
[originally from svn r5356]
2005-02-19 21:56:25 +00:00
Ben Harris 9f8182ffd7 Explicitly ignore SCI rather than translating it into DECID. Should fix
bug sci-is-not-decid.

[originally from svn r5164]
2005-01-22 14:01:01 +00:00
Owen Dunn cd58af8938 The terminal reengineering of r4609 left an unused `start' lying around.
Remove it.

[originally from svn r5134]
[r4609 == 709a94e5f2]
2005-01-18 19:04:59 +00:00
Simon Tatham 414aba9f5a In my revamp of cursor handling I had assumed that you were supposed
to call _either_ do_text() _or_ do_cursor() on a given character
cell. In fact you're supposed to call do_text() no matter what, and
then call do_cursor() as well if it's got the cursor on it, since
do_cursor() _only_ draws the actual cursor, which often doesn't also
cause the text to get drawn.

I'm half tempted to change this in the interface, retire do_cursor()
as an external function and relegate it to an internal function in
each front end, and require that do_text() must fully process all
cursor attributes it is passed. However, I haven't done this yet.

[originally from svn r5017]
2004-12-22 10:21:50 +00:00
Simon Tatham ba470dec5e I _think_ I've just fixed `font-overflow'. term->disptext now tracks
the start of every contiguous run passed to do_text() or
do_cursor(), and arranges never to overwrite only part of such a run
on the next update.

I'm a bit worried about this checkin because I've also completely
revamped cursor handling: the cursor was previously being drawn
_outside_ the main loop over the display line, and is now drawn as
part of that loop when it gets to the cursor location. It _seems_ to
still work sensibly, even in complex cases involving LATTR_WIDE and
double-width CJK characters etc, but I won't be entirely happy until
it's had some beta use.

[originally from svn r5003]
[this svn revision also touched putty-wishlist]
2004-12-17 12:55:12 +00:00
Simon Tatham f4246872c4 Divide the do_paint() loop into several subloops. The activity of
going through the line and working out which bits need to be redrawn
is now in a separate loop from the subsequent activity of actually
going through and doing the redraws. This _should_ enable me to
tinker with the which-bits-to-redraw data in between the two, thus
fixing `font-overflow'. However, I thought it would be sensible to
break the work up into two commits so we can track bugs in the
restructuring separately from bugs introduced by the new feature.

Also added a couple more terminal test files.

[originally from svn r5001]
2004-12-17 11:37:16 +00:00
Simon Tatham fb6a1e9d42 I had apparently broken wrapping of double-width characters (again).
Also fixed the new UTF-8 test file so that it tests double-width
wrapping both with _and_ without LATTR_WRAPPED2.

[originally from svn r5000]
2004-12-17 11:24:25 +00:00
Jacob Nevins a2e01a5604 Abe Crabtree complains that flushing the log file as often as we do in 0.56
results in unacceptable performance for him on Win2000. Add a checkbox to
revert to the old behaviour.

[originally from svn r4988]
[this svn revision also touched putty-wishlist]
2004-12-16 15:22:36 +00:00
Simon Tatham a10edf435b term_bidi_cache_store() now has a need to distinguish between the
_width_ of a terminal line (number of character cell positions) and
its _size_ (number of termchars), since of course these differ in
the presence of combining characters.

[originally from svn r4938]
2004-12-01 09:25:20 +00:00
Simon Tatham 44aca28fad Fix large memory leak introduced in the r4915 bidi changes.
[originally from svn r4936]
[r4915 == 569da2eb7b]
2004-11-30 13:39:58 +00:00
Simon Tatham e4e10e494b Implement xterm 256-colour mode.
[originally from svn r4917]
[this svn revision also touched putty-wishlist]
2004-11-28 15:13:34 +00:00
Simon Tatham 569da2eb7b Cursor position, selection highlights and mouse clicks are now all
transformed back and forth according to the character position
permutation output from the bidi algorithm. I was expecting that to
be a lot harder.

[originally from svn r4915]
2004-11-28 09:24:57 +00:00
Simon Tatham 92f3b101f5 Slight improvement to cursor blink timing: since the cursor doesn't
blink when the window doesn't have focus, we don't schedule blink
timers at that point either.

Infrastructure change: term->has_focus should now not be written
directly from outside terminal.c. Instead, use the function
term_set_focus, which will sort out the blink timers as well.

[originally from svn r4911]
2004-11-27 19:34:45 +00:00
Simon Tatham 7ecf13564a New timing infrastructure. There's a new function schedule_timer()
which pretty much any module can call to request a call-back in the
future. So terminal.c can do its own handling of blinking, visual
bells and deferred screen updates, without having to rely on
term_update() being called 50 times a second (fixes: pterm-timer);
and ssh.c and telnet.c both invoke a new module pinger.c which takes
care of sending keepalives, so they get sent uniformly in all front
ends (fixes: plink-keepalives, unix-keepalives).

[originally from svn r4906]
[this svn revision also touched putty-wishlist]
2004-11-27 13:20:21 +00:00
Simon Tatham 1fd5bcc9fa Fix typo in term_size(), flagged by a Dr Watson log from Temme Rainer.
[originally from svn r4881]
2004-11-22 13:49:12 +00:00
Simon Tatham 814408f2d3 DJSD requests a force-monochrome option for users who dislike angry-
fruit-salad applications :-)

[originally from svn r4762]
2004-11-09 17:57:32 +00:00
Simon Tatham d412fed542 Fix bug in scrollback compression, which manifested when attempting
to encode a very long (len>128) run of the same literal.

[originally from svn r4647]
2004-10-16 12:36:50 +00:00
Simon Tatham 70230fc0ca Fix two memory leaks in the new code. (There's no point compressing
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]
2004-10-15 12:37:44 +00:00
Simon Tatham 5f05f03fb2 Add missing check_boundary() calls in destructive backspace handler.
[originally from svn r4635]
2004-10-15 11:51:26 +00:00
Simon Tatham 833bcbb559 A combining character on U+0020 SPACE stops it from being
`uninteresting' to the clipboard processing.

[originally from svn r4634]
2004-10-15 11:42:02 +00:00
Simon Tatham 89e36c9567 Mark the trial decompress in every call to compressline() with the
XXX-REMOVE-BEFORE-RELEASE tag.

[originally from svn r4633]
2004-10-15 11:29:02 +00:00
Simon Tatham 9b37d130ed Don't forget to flush the bidi cache when the user enables or
disables bidi or shaping, otherwise they'll have to do a manual
screen refresh to see any difference.

[originally from svn r4632]
2004-10-15 11:14:42 +00:00
Simon Tatham 6b136f5c2f Store line widths in the bidi cache, so we don't fail to re-bidi a
line when the window size changes.

[originally from svn r4631]
2004-10-15 11:11:19 +00:00