1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
Commit Graph

163 Commits

Author SHA1 Message Date
Simon Tatham
f39c51f9a7 Rename most of the platform source files.
This gets rid of all those annoying 'win', 'ux' and 'gtk' prefixes
which made filenames annoying to type and to tab-complete. Also, as
with my other recent renaming sprees, I've taken the opportunity to
expand and clarify some of the names so that they're not such cryptic
abbreviations.
2021-04-26 18:00:01 +01:00
Simon Tatham
c64ad3bb0c Rename some of the more stupidly named files in the Unix back end.
Notably pterm.c, which was a sensible name right at the start but
became a misnomer as soon as I created Unix PuTTY.

[originally from svn r5053]
2004-12-31 13:02:46 +00:00
Simon Tatham
b0bf176dfb Loose end from r5031: the Kex panel should only be displayed in
mid-session if we are not using SSHv1. I've done this by introducing
a generic `cfg_info' function which every back end can use to
communicate an int's worth of data to setup_config_box; in SSH
that's the protocol version in use, and in everything else it's
currently zero.

[originally from svn r5040]
[r5031 == d77102a8d5]
2004-12-29 12:32:25 +00:00
Jacob Nevins
a27ce0492b Fix line cursor colours (fallout from `256-colours'), on both Windows and Unix.
[originally from svn r5012]
2004-12-19 22:37:05 +00:00
Simon Tatham
b3b70d749f Jacob has pointed out why SIGCHLD was blocked, so I've updated the
comment when I unblock it in pty.c to reflect reality. Also I've
moved block_signal() out of pterm.c into signal.c, so I can
conveniently use it for unblocking SIGCHLD rather than having to
reinvent it in pty.c.

[originally from svn r5006]
2004-12-17 14:25:53 +00:00
Jacob Nevins
4cb0ead447 Another default-background fix for 256-colour mode
[originally from svn r4931]
2004-11-30 01:07:29 +00:00
Simon Tatham
0600e8cf75 Bah, there's always one thing I miss. Correct the background-colour
handling in Unix PuTTY.

[originally from svn r4918]
2004-11-28 15:18:23 +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
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
Jacob Nevins
17b0d8c58e Support the SSH-2 mechanism for sending signals to a running session. Neither
of the SSH servers I conveniently have access to (Debian stable OpenSSH --
3.4p1 -- and lshd) seem to take a blind bit of notice, but the channel
requests look fine to me in the packet log.

I've included all the signals explicitly defined by
draft-ietf-secsh-connect-19, but I've put the more obscure ones in a submenu
of the specials menu; there's therefore been some minor upheaval to support
such submenus.

[originally from svn r4652]
2004-10-17 21:22:22 +00:00
Jacob Nevins
4482a79162 Telnet specials menu was not being reinstated after a session was restarted in
the same window (Windows version only).

Policy change: it's now the backend's responsibility to call
update_specials_menu() at the start of a session (or whenever it feels ready),
if it has any special commands. Otherwise the menu won't be displayed.

[originally from svn r4649]
2004-10-17 14:44:27 +00:00
Simon Tatham
1b3eb3e20d Markus Kuhn's UTF-8 page
http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate
feels strongly that it should be easy to make _all_ your
applications work in UTF-8 mode, without having to remember a switch
for each one. Every application should simply note a UTF-8 locale
setting and switch into UTF-8 mode automatically.

Therefore, for the Unix port only, there's now a checkbox, enabled
by default, which causes the drop-down Translation box to be
overridden if the locale indicates UTF-8. Anyone who doesn't like
this, or doesn't like MGK, is welcome to turn it straight back off.

I'm not _completely_ convinced by MGK's argument myself; for
xterm/pterm to do _useful_ UTF-8 you also need to specify a decently
Unicode-capable font, and there's no way _that_ can be automagically
done on noticing a locale setting. But it's a de facto standard
(i.e. xterm does it :-) so I might as well at least be _able_ to
support it.

[originally from svn r4648]
2004-10-16 14:17:58 +00:00
Simon Tatham
aa3c6302b1 And fix _cursor_ display on double-width double-width characters (as
it were).

[originally from svn r4637]
2004-10-15 12:25:51 +00:00
Simon Tatham
4eef9ce190 Double-height and double-width line attributes (ESC#3, ESC#4, ESC#6)
were not working correctly with double-width Unicode characters (CJK).

[originally from svn r4636]
2004-10-15 12:17:48 +00:00
Simon Tatham
db54732e38 Fix cursor display on a combined character cell.
[originally from svn r4625]
2004-10-15 08:51:57 +00:00
Simon Tatham
089775eb02 First-stage support for Unicode combining characters. The `chars'
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]
2004-10-14 16:42:43 +00:00
Simon Tatham
709a94e5f2 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]
2004-10-13 11:50:16 +00:00
Jacob Nevins
3a11379597 Line (as opposed to block) cursors were being displayed when they shouldn't
have been, including when they were blinked off. Fixes Debian bug #272877.

[originally from svn r4586]
2004-09-28 20:42:39 +00:00
Jacob Nevins
b892d14103 Patch to use enum constants for cfg.funky_type instead of numeric
literals, from "Anthony" <410C2A86.2010003@mail2004.ajrh.net>.

[originally from svn r4491]
2004-08-20 14:04:13 +00:00
Simon Tatham
0047bbe70f Implement `Restart Session', in both Unix and Windows PuTTY. Largely
because Owen questioned whether it was really easy enough to be
labelled `fun' in the bug database :-)

[originally from svn r4453]
2004-08-14 13:04:18 +00:00
Simon Tatham
3b647115a5 Fix double-free in X selection code.
[originally from svn r4367]
2004-07-27 15:20:37 +00:00
Jacob Nevins
20f433efac Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off.
No very good reason, but I've occasionally wanted to frob it to see if it
makes any difference to problems I'm having, and it was easy.

Tested that it does actually cause keepalives on Windows (with tcpdump);
should also work on Unix. Not implemented on Mac (does nothing), but then
neither is TCP_NODELAY.

Quite a big checkin, much of which is adding `keepalive' alongside `nodelay'
in network function calls.

[originally from svn r4309]
2004-06-20 17:07:38 +00:00
Simon Tatham
be5133f376 Arnaud Desitter points out a silly mistake in retrieve_cutbuffer()
(don't test for `int *nbytes' being <= 0, test for the integer it
points to being <= 0!).

[originally from svn r4254]
2004-05-24 11:30:15 +00:00
Simon Tatham
2ff7b4385f Fix indentation after Richard B's patch in rev 1.137 [r3409].
[originally from svn r4241]
[r3409 == 7798a59987]
2004-05-22 14:21:27 +00:00
Simon Tatham
46f26ee483 Richard B's patch to enable users to explicitly request shadow bold
by disabling bold-font-name guessing (if their bold fonts are ugly).
I've turned the UI inside out, but the meat is pretty much the same.

[originally from svn r3410]
2003-08-21 18:39:17 +00:00
Simon Tatham
7798a59987 Richard B's patch to support X cut buffers as well as ordinary
selections, meaning that (a) a pterm can leave copied text in the
cut buffer after it terminates so that applications can pick it up
even though it isn't still around to deliver the selection in
person, and (b) pterm can pick up things left in this way by other
apps.
Downside is that all of this only happens in ISO8859-1, because X is
weird like that.

[originally from svn r3409]
2003-08-21 18:07:27 +00:00
Simon Tatham
11c9c018ec Richard Boulton's patch for improved correctness in selection
handling (generally, selection request timestamps should be set to
the timestamp on the event that caused them).

[originally from svn r3408]
2003-08-21 18:03:06 +00:00
Simon Tatham
d49e6e1476 Real COMPOUND_TEXT support! I was expecting to have to read the spec
and implement the required subset of ISO-2022 in libcharset, but it
turns out that Xlib provides conversion functions between UTF-8 and
compound text, which are just about ideal for us. So now we can
paste multilingual stuff both to and from emacs21. Rock on.

[originally from svn r3193]
2003-05-13 19:57:17 +00:00
Simon Tatham
ef2ccb56cf Allow pterm to receive selections in compound text format. Doesn't
actually _understand_ compound text yet - anything with
non-ASCII-or-8859-1 characters will fail miserably - but it will at
least successfully receive plain text if the pasting application
doesn't see fit to give it out in any other format.

[originally from svn r3192]
2003-05-13 18:43:30 +00:00
Simon Tatham
99bef3d3cf Debian bug #193013 points out that the (default-)one-pixel border is
not redrawn when the window background colour is reconfigured mid-
session. In addition, the Official Window Background is not reset,
meaning that opaque resizes etc will flicker in the old background
colour. This checkin should fix both.

[originally from svn r3190]
2003-05-13 18:14:14 +00:00
Simon Tatham
4b5ce3f46f pterm will now attempt to guess suitable names for any missing fonts
from the ones given; so it'll ask for a font twice as wide as your
base one if you don't specify a wide font, it'll ask for a bolded
version of your base font if you don't specify a bold font, and
similarly for a wide/bold font. Should solve Debian bug #187389; at
least it works for me.

[originally from svn r3175]
2003-05-10 10:15:00 +00:00
Simon Tatham
724fee3dca Stupid braino in get_window_title (thanks Colin): window and icon
titles were being reported the wrong way round. Should fix half of
Debian bug #191751.

[originally from svn r3173]
2003-05-10 09:05:41 +00:00
Simon Tatham
9a242f06ba Fixes for Debian bug #192701 (64-bit gccs warn about casts between
ptrs and ints of different size and -Werror makes this serious).
The GTK bits are done by Colin's patch to use GINT_TO_POINTER
(thanks); the uxnet bits are done by cleaning up the rest of the
code. In particular, network.h now typedefs `OSSocket' to be a type
capable of holding whatever the OS's socket data type is that
underlies our socket abstraction. Individual platforms can make this
typedef themselves if they define OSSOCKET_DEFINED to prevent
network.h redoing it; so the Unix OSSocket is now int. Default is
still void *, so other platforms should be unaffected.

[originally from svn r3171]
2003-05-10 08:35:54 +00:00
Simon Tatham
24d6da8041 Reinstate `-T title', in pterm only.
[originally from svn r3165]
2003-05-06 19:55:00 +00:00
Simon Tatham
6bb121ecb9 Colin's const-fixing Patch Of Death. Seems to build fine on Windows
as well as Unix, so it can go in.

[originally from svn r3162]
2003-05-04 14:18:18 +00:00
Simon Tatham
082cf832c5 Support for non-ISO-8859-1 X keysyms. So in particular, pterm in a
Euro-supporting font with a Euro-enabled X key map will now actually
generate a Euro character rather than shrugging and doing nothing.

[originally from svn r3151]
2003-04-27 11:10:48 +00:00
Simon Tatham
3a3e4d1818 Make the `vtmode' config option work under X. In the process I've
had to move another of its values out into wincfg.c - paradoxically,
this was the `font has X encoding' option! (Because the Unix font
handling code expects to be able to tell for _itself_ whether it has
a font with X-encoded line drawing glyphs.)

[originally from svn r3145]
2003-04-26 14:22:42 +00:00
Simon Tatham
88e0914f91 Aha, _that's_ why the icon title didn't work properly in pterm:
gtk_window_set_title() overwrote both titles at once. Icon title is
now working properly under X, and since X was the reason for the
whole icon/window title separation _anyway_ they default to being
separate.

[originally from svn r3144]
2003-04-26 13:55:47 +00:00
Simon Tatham
426dc87712 Don't block SIGPIPE until _after_ pterm forks, since otherwise the
blockage will propagate to the child process.

[originally from svn r3139]
2003-04-25 15:44:01 +00:00
Simon Tatham
041dcfd83d Unix makefile now uses -O2, which massively cuts down key exchange
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]
2003-04-23 13:48:09 +00:00
Simon Tatham
214b306909 Support for New Session, Duplicate Session and the Saved Sessions
submenu in Unix PuTTY, and Duplicate Session also in pterm. You do
_not_ want to know how this is done. Be warned.

[originally from svn r3110]
2003-04-12 17:37:15 +00:00
Simon Tatham
eaaef4573c Further fiddlings with the size reconfiguration stuff; now
everything seems to work right even when the only thing changed was
the window border.

[originally from svn r3109]
2003-04-12 11:03:44 +00:00
Simon Tatham
a9b6ceb700 Mid-session reconfiguration of scrollback was failing (in Unix)
except when width or height had _also_ been changed. Fixed.

[originally from svn r3108]
2003-04-12 10:44:14 +00:00
Simon Tatham
56a4e967da Implement the ldisc `special' mechanism in Unix, without which local
line editing didn't work at all.

[originally from svn r3107]
2003-04-12 09:27:56 +00:00
Simon Tatham
bc4e41154a Close On Exit and Warn On Close fixes: (a) pty_reconfig needs to
remember changes in COE so it knows whether to print a message, and
(b) once the session has already ended, Warn On Close should shut up.

[originally from svn r3102]
2003-04-12 08:27:03 +00:00
Simon Tatham
c16bde1741 When I implemented the GTK messagebox() function and everything that
needed to use it, I completely forgot about askappend(). D'oh.

[originally from svn r3101]
2003-04-11 18:44:05 +00:00
Simon Tatham
d93f7113d1 Rationalisation of the system of frontend handles. Most modular bits
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]
2003-04-11 18:36:27 +00:00
Simon Tatham
8e3c37d309 Implement Warn On Close.
[originally from svn r3099]
2003-04-11 18:15:47 +00:00
Simon Tatham
ed46f3aa53 `Copy All' ought to de-highlight any existing selection, in line
with any other operation that shifts the X selection to stuff other
than the highlighted text.

[originally from svn r3098]
2003-04-11 18:10:13 +00:00