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

1224 Commits

Author SHA1 Message Date
Simon Tatham
f2834e065d Brief man pages for PuTTY and PuTTYtel.
[originally from svn r3188]
2003-05-11 14:32:43 +00:00
Simon Tatham
0b166ad0f8 Missing full stop.
[originally from svn r3187]
2003-05-11 14:19:57 +00:00
Simon Tatham
f36cd3a7f8 Some time ago I arranged for -geometry to be able to specify window
position as well as size. Now reflected in manpage.

[originally from svn r3186]
2003-05-11 14:19:17 +00:00
Simon Tatham
80c3a23abc I think I've just fixed Debian bug #166396. The +ut option was
causing pty_utmp_helper_pipe to be closed, but its fd was kept
around even when stale, and closed again when the main child process
terminated - by which time the fd number had been reused for a
rather more vital fd, which GTK didn't appreciate having closed
under its feet. Hence, spin on POLLNVAL. Should now be sorted.

[originally from svn r3185]
2003-05-11 12:28:53 +00:00
Simon Tatham
2715630ac1 Remove the now incorrect `Unicode is not supported' from the bugs in
the pterm man page :-)

[originally from svn r3176]
2003-05-10 10:15:36 +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
a2b8d10cd3 pterm's manpage now documents the NoRemoteQTitle resource. Should
fix the other half of Debian bug #191751.

[originally from svn r3174]
2003-05-10 09:06: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
6b362191f1 Bah. Stop the Proxy panel appearing empty in Change Settings. One
day I'll make a reasonably big checkin and _not_ have six tiny mop-
up issues after it...

[originally from svn r3169]
2003-05-07 13:14:48 +00:00
Simon Tatham
8460ecd27d Yesterday's proxy enhancements also slightly nadgered the config
box, in that it started to expand under the weight of proxy options.
Now fixed, by folding the SOCKS version selector into the general
proxy type selector so there's one single 5- or 6-way radio button
set split over two lines. settings.c has of course grown a backwards
compatibility wart to deal with legacy config data.

[originally from svn r3168]
2003-05-07 12:07:23 +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
03fa61025b Support, on Unix only (so far), for OpenSSH-style generic proxying
(running a local command in a pair of pipes and proxying through
that, for example `ssh proxyhost nc -q0 %host %port').

[originally from svn r3164]
2003-05-06 19:52:31 +00:00
Owen Dunn
5e36ac8d67 Update to use -title rather than -T
[originally from svn r3163]
2003-05-06 08:43:11 +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
f6a208fbdd First half of `pageant-async' work. agent_query() is now passed a
callback function; it may return 0 to indicate that it doesn't have
an answer _yet_, in which case it will call the callback later on
when it does, or it may return 1 to indicate that it's got an answer
right now. The Windows agent_query() implementation is functionally
unchanged and still synchronous, but the Unix one is async (since
that one was really easy to do via uxsel). ssh.c copes cheerfully
with either return value, so other ports are at liberty to be sync
or async as they choose.

[originally from svn r3153]
2003-04-28 11:41:39 +00:00
Simon Tatham
2e2b6d89bd Add puttytel binary to .cvsignore
[originally from svn r3152]
2003-04-27 11:11:35 +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
1f5780ad9f Remove the TODO comment at the top of uxputty.c; I'm now not aware
of anything that makes the Unix port of PuTTY proper significantly
unfinished. That's quite a milestone :-)

[originally from svn r3148]
2003-04-26 14:37:49 +00:00
Simon Tatham
79426308bf Finer granularity of config box handling. SSH packet logging should
now not show up when it's meaningless (in PuTTYtel, in pterm, and
in the middle of any non-SSH session), and the Connection panel is
inhibited completely in pterm.

[originally from svn r3146]
2003-04-26 14:35:34 +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
ec3595f7d4 Removing items from a list box using gtk_container_remove is nasty,
because when the selected item is removed the selection moves on to
another item. Thus, calling dlg_listbox_clear causes repeated
selchanges in the list, which in turn cause repeated valchanges if
the list is attached to a combo box. This has been completely
scuppering the Translation panel.

[originally from svn r3130]
2003-04-18 09:14:54 +00:00
Simon Tatham
22d8cfe36f Missed out a couple of uxsel_tell() which were hanging forwarded X
connections in at least some situations. Oops.

[originally from svn r3128]
2003-04-18 09:00:37 +00:00
Ben Harris
d66a1d685f Replace use of FIONBIO with POSIX-approved O_NONBLOCK (set using fcntl()).
This should save us having to worry about different OSs' defining it in
different headers.

[originally from svn r3126]
2003-04-16 23:58:59 +00:00
Ben Harris
e7c7f5e3f8 Make IPv6 support for Unix work, and make it a lot simpler in the process.
At the moment, we have to assume that getaddrinfo() will only return AF_INET
and AF_INET6 addresses, since we patch in the port number into the sockaddr
later.  Fixing this is probably best done by redesigning the PuTTY network
abstraction a little.

[originally from svn r3125]
2003-04-16 23:33:44 +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
Simon Tatham
1be4188a3c `Copy All' context-menu item, for what it's worth.
[originally from svn r3097]
2003-04-11 17:59:36 +00:00
Simon Tatham
1be575d9c4 Saving of Default Settings under Unix was broken, because mungestr()
was translating NULL into "Default Settings" but not doing the same
to "". Now fixed.

[originally from svn r3096]
2003-04-11 17:42:52 +00:00
Simon Tatham
d710c84dec Cutting and pasting from the Unix Event Log.
[originally from svn r3095]
2003-04-11 17:40:52 +00:00
Simon Tatham
2e1503e520 Implemented Change Settings under Unix. We are gradually getting there.
[originally from svn r3092]
2003-04-10 18:00:50 +00:00
Simon Tatham
f03cf02cc8 All the stderr messages in this file now use appname rather than
guessing wrongly.

[originally from svn r3089]
2003-04-10 11:57:11 +00:00
Simon Tatham
406d2d8a32 Minor improvements to subsidiary window placement; with any luck the
Event Log should go off the side of the screen rather less often now.

[originally from svn r3088]
2003-04-10 08:53:43 +00:00
Simon Tatham
b49980b953 Event Log for Unix PuTTY. Doesn't yet allow X selection of its
contents, and doesn't automatically maintain scroll position at the
bottom when new entries are added while the list is open, but it's a
start.

[originally from svn r3087]
2003-04-09 18:46:45 +00:00
Simon Tatham
98a608c2e4 Rename pterm's -T option to -title, to avoid clashing with PuTTY's
-T (don't allocate a pty) option.

[originally from svn r3079]
2003-04-08 14:02:34 +00:00
Simon Tatham
fe666b2432 While writing gtkdlg.c I learned how to specify a window's initial
position in GTK, so I can now implement the other half of -geometry
which I'd previously believed to be impossible in GTK. It's still
not perfect, because GTK apparently provides no way for us to get
hold of the X reparent event in order to support negative geometries
in a manner which takes account of the WM borders; but for positive
position it's at least an improvement on the previous version!

[originally from svn r3078]
2003-04-08 13:49:12 +00:00
Simon Tatham
b0ee81ab32 Now that we have `appname', make much wider use of it. In
particular, the config box uses it in place of the word `PuTTY',
which means mid-session reconfig in pterm will look less strange
once I implement it. Also, while I'm at it, I've personalised all
the dialog boxes and menu items and suchlike so that PuTTYtel
actually claims to be PuTTYtel rather than PuTTY.

[originally from svn r3074]
2003-04-06 14:11:33 +00:00
Simon Tatham
cf08c5a64a Fixed the printing and charset combo boxes in Unix PuTTY. (The
former by simply removing it; the latter by adding an enumeration
function to libcharset.) This has had slight `const' repercussions
on cp_name() and cp_enumerate() which might break the Mac build.

[originally from svn r3064]
2003-04-05 16:36:11 +00:00
Simon Tatham
09c9f31289 Unix can't sensibly enumerate printers (since they're defined as
being lpr commands), so the Unix config box now replaces the printer
combo box with an ordinary edit box.

[originally from svn r3063]
2003-04-05 16:12:52 +00:00
Simon Tatham
30497ff683 Ctrl+rightclick now pops up a context menu in Unix PuTTY and pterm.
This menu is not yet fully populated, but it has an About box (yet
another licence location :-/ ) and supports the new configurable
specials menu (thus making Unix PuTTY do one tiny thing which
OpenSSH-in-a-pterm can't :-).

[originally from svn r3062]
2003-04-05 16:05:00 +00:00
Simon Tatham
8a3ff2bf3e Dynamic port forwarding by means of a local SOCKS server. Fully
supports SOCKS 4, SOCKS 4A and SOCKS 5 (well, actually IPv6 in SOCKS
5 isn't supported, but it'll be no difficulty once I actually get
round to it). Thanks to Chas Honton for his `stone soup' patch: I
didn't end up actually using any of his code, but it galvanised me
into doing it properly myself :-)

[originally from svn r3055]
2003-04-05 11:45:21 +00:00
Simon Tatham
3bd0415579 Turned the old `Telnet Command' System-submenu into a more general
`Special Command' menu, in which any backend can place its own list
of magical things the user might want to ask the backend to do. In
particular I've implemented the recently proposed "break" extension
in SSH2 using this mechanism.
NB this checkin slightly breaks the Mac build, since it needs to
provide at least a stub form of update_specials_menu().

[originally from svn r3054]
2003-04-04 20:21:05 +00:00
Simon Tatham
a05d4fdbd0 Further .cvsignore updates.
[originally from svn r3044]
2003-04-02 09:14:38 +00:00
Simon Tatham
6504c5c894 Improvements to .cvsignore, to attempt to reduce the huge number of
? lines I see when running `cvs update', which in turn might help
deal with my tendency to forget to `cvs add' new files before a big
checkin :-)

[originally from svn r3042]
2003-04-02 08:44:05 +00:00
Simon Tatham
7706da5e17 Various error-handling fixes, mostly in Unix PuTTY but one (failure
to save a session) crosses over into the platform-independent side.

[originally from svn r3041]
2003-04-01 18:10:25 +00:00
Simon Tatham
ec6d5edb62 Trivial segfault fix from Richard B.
[originally from svn r3036]
2003-03-31 12:57:36 +00:00
Simon Tatham
2487fdd9b4 Ahem; update the TODO to reflect the cmdline changes :-)
[originally from svn r3035]
2003-03-31 12:11:21 +00:00
Simon Tatham
62844b4590 Support for PuTTY-style command-line arguments in Unix PuTTY. I
think it's now actually usable as a day-to-day SSH client, even if
things like the Event Log are still missing. So I call that a decent
lunch hour's work :-)

[originally from svn r3034]
2003-03-31 12:10:53 +00:00
Simon Tatham
3a41ec782e And everyone's favourite cosmetic change: Unix PuTTY now doesn't
claim to be pterm in the window title :-)

[originally from svn r3032]
2003-03-31 11:42:45 +00:00
Simon Tatham
0ec4f0620d Can now save and load settings under Unix.
[originally from svn r3031]
2003-03-31 11:36:14 +00:00
Simon Tatham
a7e6d60915 Fix a _very_ subtle segfault in my two GTK container classes: the
`forall' function has to be prepared for the list of widgets to
change along the way if (for example) the callback function destroys
its input widget.

[originally from svn r3029]
2003-03-31 11:22:06 +00:00
Simon Tatham
823f52c540 Checkin of last night's work on GTK message boxes. Unix PuTTY now
has proper GUI prompts for host keys etc, so it should now be usable
without a controlling tty.

[originally from svn r3028]
2003-03-31 11:21:07 +00:00
Simon Tatham
a3428ae953 Having created and used uxsel, it actually turns out to be
practically trivial to put all the pieces together and create a
working prototype of Unix PuTTY! It's missing a lot of things -
notably GUI request boxes for host keys and logfiles and so forth,
the Event Log, mid-session reconfiguration, session loading and
saving, sensible population of the character sets drop-down list and
probably other fiddly little things too - but it will put up a
config box and then create a GUI window containing an SSH connection
to the host you specified, so it's _basically_ there. Woo!

[originally from svn r3020]
2003-03-29 19:52:50 +00:00
Simon Tatham
5107780c54 pterm now uses the new uxsel module, so it's one step closer to
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]
2003-03-29 18:30:14 +00:00
Simon Tatham
b109918032 Added uxsel.c, into which I've moved those parts of the uxnet.c
functionality that deal with selectable fds in general. The idea is
that pty.c will stop passing its fd straight to pterm.c and hand it
to this module instead, and pterm.c will start requesting a general
list of fds from this module rather than expecting a single one from
pty.c, with the ultimate aim of pterm.c being able to form the basis
of a Unix PuTTY as well as pterm proper.

[originally from svn r3015]
2003-03-29 16:47:06 +00:00
Simon Tatham
d36a4c3685 Introduced wrapper macros snew(), snewn() and sresize() for the
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]
2003-03-29 16:14:26 +00:00
Ben Harris
c8c17d2cef Rename dlg_listbox_addwithindex() to dlg_listbox_addwithid(), since the old
name was, not to put too fine a point on it, wrong.

[originally from svn r2997]
2003-03-25 23:45:56 +00:00
Simon Tatham
c42085dc89 Various cosmetic fixes to the GTK config box: vertical alignment of
edit box labels, Left/Right on the treeview to collapse and expand
branches, a window title, and the best treatment of wrapping text
widgets I could think of within the product-order-oriented GTK
layout model. I think this thing is now pretty much as good as it's
going to get before GTK v2 (which should fix one or two remaining
minor nasties which I really couldn't be bothered to work around in
GTK 1.2), so the next step is to actually start _using_ it.

[originally from svn r2979]
2003-03-22 17:00:06 +00:00
Simon Tatham
3100306c90 Better appearance and positioning for dlg_error_msg box, and also
I've just found out that it's easy to ask for the config box to be
centred on the screen by default, which is kinda cool.

[originally from svn r2962]
2003-03-18 19:47:28 +00:00
Simon Tatham
4d41247cde Big sprawling dialog-box commit covering all sorts of things.
Buttons now have an `iscancel' flag to go with `isdefault';
dlg_last_focused() now explicitly passes the control it _doesn't_
care about (`I want the last control that had focus and isn't this
one'); and in the GTK implementation, various fixes have happened,
notably including arrow keys working sensibly in list boxes and the
treeview and short font aliases being expanded correctly to
initialise the font selectors.

[originally from svn r2958]
2003-03-18 19:06:51 +00:00
Simon Tatham
f9f695b72a Further work on the GTK config box; mostly implemented keyboard
shortcuts now (only treeviews and list boxes to go, which currently
do very weird things and I need to overhaul them completely).

[originally from svn r2944]
2003-03-16 12:37:48 +00:00
Simon Tatham
b4e7ec8b12 Fixed accelerator clash in the Unix-specific config, since gtkdlg.c
is now competent to detect them :-)

[originally from svn r2943]
2003-03-16 12:36:33 +00:00
Simon Tatham
d681abb508 When a piece of text overflows its column in a tabbed list box, I
think on balance I rather like the natural behaviour of the way I've
done it, except that non-zero separation between the columns would
be even nicer. Accordingly, here is some.

[originally from svn r2940]
2003-03-15 15:56:51 +00:00
Simon Tatham
6a67fdc0cc Event handling in the GTK dialog engine is now basically present and
correct. All the callbacks are getting called, all the dialog
actions are working (the port forwarding, colour and charclass
configurers are all completely functional), file, font and colour
selectors happen, and it's all looking pretty cool.

[originally from svn r2938]
2003-03-15 15:50:42 +00:00
Simon Tatham
fca92a5b43 Continuing work on the GTK config box. Created uxcfg.c for the
Unix-specific config items; moved a stray Windows-specific config
item (scrollbar-in-fullscreen) out into wincfg.c to stop it
appearing on Unix; continued updates to gtkdlg.c. I now believe the
GTK config box looks basically correct (modulo minor cosmetic issues
and keyboard accelerators). Next step, add the event handling so
it's actually functional.

[originally from svn r2933]
2003-03-14 18:35:01 +00:00
Simon Tatham
df85003ea5 First stab at a GTK layout engine. It's missing all sorts of stuff
(list boxes are particularly conspicuously absent), it has no event
handling at all, and it isn't in any way integrated into pterm - you
have to build it specially using the test stubs in gtkdlg.c. But
what there is so far seems to work plausibly well, so it's a start.
Rather than browbeat the existing GTK container/layout widgets into
doing what I wanted, I decided to implement two subclasses of
GtkContainer myself, which implement precisely the layout model
assumed by the config box specification; this has the rather cool
consequence that the box can be resized and will maintain the same
layout at all times that it would have had if initially created at
that size.

[originally from svn r2931]
2003-03-13 19:52:28 +00:00
Simon Tatham
73203bce79 Never pass a `char' to a ctype function. I had relied on gcc -Wall
letting me know about instances of this, but it turns out that my
ctype.h explicitly casts input values to `int' to evade the
`subscript has type char' warning, so it had been carefully not
letting me know! Found them all by compiling with a doctored
ctype.h, and hopefully fixed them all too.

[originally from svn r2927]
2003-03-11 09:30:31 +00:00
Simon Tatham
6f693ffeb0 Reorganisation of misc.c: Minefield has moved out to winmisc.c, and
so has the Windows dputs() - which has also acquired a Unix
counterpart in uxmisc.c. -DDEBUG should now work on Unix.

[originally from svn r2914]
2003-03-06 13:24:02 +00:00
Simon Tatham
83da92826e Richard B's patch to add WINDOWID support to pterm.
[originally from svn r2912]
2003-03-06 12:57:37 +00:00
Simon Tatham
bd16b29a7a Oops, Ben is quite right about the rather appalling design of
filename_from_str. Here's a better fix, with some const
repercussions too.

[originally from svn r2768]
2003-02-01 17:24:27 +00:00
Simon Tatham
f26b7aa0d3 Created new data types Filename' and FontSpec', intended to be
opaque to all platform-independent modules and only handled within
per-platform code. `Filename' is there because the Mac has a magic
way to store filenames (though currently this checkin doesn't
support it!); `FontSpec' is there so that all the auxiliary stuff
such as font height and charset and so on which is needed under
Windows but not Unix can be kept where it belongs, and so that I can
have a hope in hell of dealing with a font chooser in the forthcoming
cross-platform config box code, and best of all it gets the horrid
font height wart out of settings.c and into the Windows code where
it should be.
The Mac part of this checkin is a bunch of random guesses which will
probably not quite compile, but which look roughly right to me.
Sorry if I screwed it up, Ben :-)

[originally from svn r2765]
2003-02-01 12:54:40 +00:00
Simon Tatham
52882fa006 And another bit missing from the settings changes: pterm's platform
default for CloseOnExit was encoded wrongly. Hopefully this should
be everything now; I'm really starting to get sick of picking up the
pieces after my two checkins yesterday. Perhaps I should have waited
until I had a brain before doing them in the first place.

[originally from svn r2746]
2003-01-28 12:06:37 +00:00
Simon Tatham
c370336a92 xterm apparently supports ESC[90m through ESC[97m to set bright
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]
2003-01-27 23:03:31 +00:00
Simon Tatham
6aa4211f6e Remove all `enum'-typed variables from the Config structure.
Everything in there which is integral is now an actual int, which
means my forthcoming revamp of the config box will be able to work
with `int *' pointers without fear of doom.

[originally from svn r2733]
2003-01-27 18:02:24 +00:00
Simon Tatham
063469571a Fix Unix breakage from term_mouse() revamp too.
[originally from svn r2723]
2003-01-25 16:23:48 +00:00
Ben Harris
af4be2e83e Change the term_mouse interface a little so that it gets passed
both the raw and the cooked mouse button, with the mapping being done in
advance by the front-end.  This is useful because it allows the front-end to
use information other than the raw button (e.g. the modifier state) to decide
which cooked button to generate.
.
Front ends other than the Mac one are untested, but they just call
translate_button() themselves and pass the result to term_mouse().

[originally from svn r2721]
2003-01-25 16:16:45 +00:00
Ben Harris
81ada5f24f Add a stub "free" routine for pterm. Thanks to rjk.
[originally from svn r2666]
2003-01-20 20:10:07 +00:00
Simon Tatham
f6cc852c5d Miscellaneous fixes to finish up `remove-statics'. rlogin.c had a
holdout static I hadn't noticed; unicode.c had one too; and a large
number of statics that were perfectly OK due to being constants have
been made `const', with assorted `const' repercussions all over the
place. I now declare `remove-statics' to be fixed.

[originally from svn r2594]
2003-01-14 18:43:45 +00:00
Simon Tatham
b2374a64fd Deglobalise the Unicode module. Despite all my grand plans, I've
just done this the very simple way - bundle all the globals into a
data structure and pass pointers around. One particularly ugly wart
is that wc_to_mb now takes a pointer to this structure as an
argument (optional, may be NULL, and unused in any Unicode layer
that's even marginally less of a mess than the Windows one). I do
need to do this properly at some point, but for now this should just
about be adequate. As usual, the Mac port has not been updated.

[originally from svn r2592]
2003-01-14 18:28:23 +00:00
Owen Dunn
5c7bc54022 Ctrl-PgUp and Ctrl-PgDn now scroll by one line on Unix and Windows
[originally from svn r2582]
2003-01-14 11:24:26 +00:00
Simon Tatham
4ec4de4f8b Ahem. Doing loads of stuff to inst->cfg would probably be best done
_after_ allocating inst. Oops.

[originally from svn r2571]
2003-01-12 15:45:29 +00:00
Simon Tatham
d119b784f8 Ahem. Global replace of cfg' with inst->cfg' is all very well, but
let's try to make sure it doesn't happen inside any strings! The
-cfg option for cursor foreground colour nearly had a nasty accident
there.

[originally from svn r2569]
2003-01-12 15:36:05 +00:00
Simon Tatham
6af1a9e4e9 Having laid all the groundwork, we can now remove the global `cfg'
completely from putty.h. It's now static in each of the command-line
front ends, shared only between window.c and windlg.c in PuTTY
proper (I've tested this by doing #define cfg cfgsillyname in those
two files only, and it still links so nobody else is using that
symbol!), and part of the `inst' structure in pterm. I think that
only leaves the Unicode module as the last stubborn holdout in the
anti-global-variables campaign.

[originally from svn r2568]
2003-01-12 15:32:31 +00:00
Simon Tatham
952857fca3 proxy.c now no longer refers to `cfg'. Instead, each of the three
proxy-indirection network functions (name_lookup, new_connection,
new_listener) takes a `const Config *' as an argument, and extracts
enough information from it before returning to handle that
particular network operation in accordance with the proxy settings
it specifies. This involved {win,ux}net.c due to a `const'
repercussion.

[originally from svn r2567]
2003-01-12 15:26:10 +00:00
Simon Tatham
2d469ba497 The logging module now contains a local copy of cfg too.
[originally from svn r2566]
2003-01-12 15:10:27 +00:00
Simon Tatham
ac2367bc72 The Unicode module no longer depends on `cfg', since it gets the
relevant bits of it passed in to init_ucs(). (Actually I pass in all
of it in the Windows version, since it's a bit hairy in there.)

[originally from svn r2565]
2003-01-12 14:59:54 +00:00
Simon Tatham
6a2c0436de printer_start_job shouldn't need to refer to cfg.printer, since it's
getting the printer name passed in anyway! Oops.

[originally from svn r2563]
2003-01-12 14:50:34 +00:00
Simon Tatham
520f716dec Just like under Windows, cleanup_exit() shouldn't need to check
before calling random_save_seed().

[originally from svn r2562]
2003-01-12 14:49:44 +00:00
Simon Tatham
f49c8c5a07 The back ends now contain their own copies of the Config structure,
and have a function to pass in a new one. (Well, actually several
back ends don't actually bother to do this because they need nothing
out of Config after the initial setup phase, but they could if they
wanted to.)

[originally from svn r2561]
2003-01-12 14:48:29 +00:00
Simon Tatham
f35cbdce44 Forgot to match the cmdline changes in the Unix port.
[originally from svn r2558]
2003-01-12 14:37:26 +00:00
Simon Tatham
1b5cb7adf6 Each platform's implementation of askappend() is no longer required
to consult cfg.logxfovr, because it gets done once in logging.c.
askappend() is now called only when a question _really_ needs to be
asked of the user. Also in this checkin, cleanup_exit() in console.c
no longer consults cfg.protocol to decide whether to save the random
seed, because random_save_seed() can make that decision for itself
and do it better.

[originally from svn r2552]
2003-01-12 13:44:35 +00:00
Simon Tatham
fda9983243 Hack around an oddity in X display names and xauth.
[originally from svn r2538]
2003-01-11 09:46:50 +00:00
Simon Tatham
87f9446a26 Support XDM-AUTHORIZATION-1 for connecting to local X servers. If
we're going to be a security program, we can at least make a token
effort to use the most secure local X auth available! And I'm still
half-tempted to see if I can support it for remote X servers too...

[originally from svn r2537]
2003-01-11 09:31:54 +00:00
Simon Tatham
86977efa81 Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)

[originally from svn r2536]
2003-01-10 18:33:35 +00:00
Simon Tatham
35cd654c75 Unix plink now catches SIGWINCH and propagates local terminal
resizes to the remote end.

[originally from svn r2515]
2003-01-09 18:28:01 +00:00
Simon Tatham
f928707849 Support asynchronous connect() in Unix networking. Now a port
forwarding to a nonexistent host shouldn't hold up the rest of the
program.

[originally from svn r2514]
2003-01-09 18:14:24 +00:00
Simon Tatham
4d86f5979d I'm sick of all those #ifdefs in settings.c, and in any case plink
and pterm need at least one default setting to be _different_ (pterm
needs the default term type to be `xterm', while plink needs it to
be taken from $TERM). So here's a completely new alternative
mechanism for platform- and app-specific default settings. Ben will
probably want to check the integrity of the Mac port, since I've
fiddled with it without testing that it still compiles.

[originally from svn r2513]
2003-01-09 18:06:29 +00:00
Simon Tatham
b527354246 Ahem. Now pterm actually uses wc_to_mb in a situation where it needs
to pass in a default character, it would help if wc_to_mb actually
_honoured_ the default-character parameter.

[originally from svn r2490]
2003-01-07 13:09:56 +00:00
Simon Tatham
106bf20b35 Work around a weird bug in gdk_draw_text_wc().
[originally from svn r2437]
2003-01-03 17:52:51 +00:00
Simon Tatham
ea5be2db38 Fixes to direct-to-font mode: I'd inadvertently enabled it for any
font whose encoding comes up as CS_NONE - but this is also true for
iso10646-1 fonts, since libcharset doesn't support wide-character
encodings! Hence UTF-8 cut and paste was enabled in ordinary modes,
but disabled in UTF-8 mode, which was a bit embarrassing. Now we
have a dedicated flag variable indicating direct-to-font mode.

[originally from svn r2425]
2003-01-02 16:17:56 +00:00
Simon Tatham
2435c54597 sk_nonamelookup() should ensure the sockaddr it returns has `error'
set to NULL. Otherwise it'll be random uninitialised goop. Not good.

[originally from svn r2416]
2003-01-02 10:07:50 +00:00
Simon Tatham
cab553028a Proper support for using the font's own character encoding. If we
know what that encoding actually is, we can do our best to support
additional charsets (VT100 linedrawing, SCO ACS, UTF-8 mode) using
the available characters; if we don't, we fall back to a mode where
we disable all Unicode cut-and-paste and assume any Unicode
character is undisplayable.

[originally from svn r2413]
2003-01-01 22:25:25 +00:00
Simon Tatham
d97ac46223 Support for double-width (CJK) characters, using the xterm-like
options -fw and -fwb to specify wide and wide-bold fonts.

[originally from svn r2412]
2003-01-01 21:53:22 +00:00
Simon Tatham
ad2bbc52a4 First draft of Unicode support in pterm. It's pretty complete: it
does UTF-8 copy and paste (falling back to normal strings if
necessary), it understands X font encodings and translates things
accordingly so that if you have a Unicode font you can ask for
virtually any single-byte encoding and get it (Mac-Roman pterm,
anyone?), and so on. There's work left to be done (wide fonts for
CJK spring to mind), but I reckon this is a pretty good start.

[originally from svn r2395]
2002-12-31 12:20:34 +00:00
Simon Tatham
a564ad3140 Support for doing DNS at the proxy end. I've invented a new type of
SockAddr, which just contains an unresolved hostname and is created
by a stub function in *net.c. It's an error to pass this to most of
the real-meat functions in *net.c; these fake addresses should have
been dealt with by the time they get down that far. proxy.c now
contains name_lookup(), a wrapper on sk_namelookup() which decides
whether or not to do real DNS, and the individual proxy
implementations each deal sensibly with being handed an unresolved
address and avoid ever passing one down to *net.c.

[originally from svn r2353]
2002-12-18 16:23:11 +00:00
Simon Tatham
8304f4e0dc Stop proxying connections to localhost by default; should fix
`x11-proxy-crash'.

[originally from svn r2348]
2002-12-18 12:18:54 +00:00
Simon Tatham
99b870dbc6 Implement `portfwd-loopback-choice'. Works on local side in Unix as
well, though it's a lot less useful since you still can't bind to
low-numbered ports of odd loopback IPs. Should work in principle for
SSH2 remote forwardings as well as local ones, but OpenSSH seems
unwilling to cooperate.

[originally from svn r2344]
2002-12-18 11:39:25 +00:00
Owen Dunn
269557cb64 Avoid potential memory leak.
[originally from svn r2278]
2002-12-04 12:53:42 +00:00
Simon Tatham
06a8f88e58 #include <signal.h>. Compiled fine without it on Debian 3.0, but not
on 2.2. Wonder what changed.

[originally from svn r2277]
2002-12-04 12:40:36 +00:00
Owen Dunn
cd3252bb66 Changed to use strerror()
[originally from svn r2276]
2002-12-04 12:39:32 +00:00
Ben Harris
d60ea36673 Add a Config * argument to ldisc_create(), and use it in place of the global
cfg throughout ldisc.c.  Not tested other than on Mac, but all other ports
just pass &cfg as this argument for now.

[originally from svn r2250]
2002-11-23 20:02:38 +00:00
Ben Harris
8280e645e4 Add a "Config *" argument to term_init(), and use that instead of the global
cfg throughout the terminal emulator.  Not tested in PuTTY and pterm, but they
just pass in &cfg.

[originally from svn r2248]
2002-11-23 19:01:01 +00:00
Simon Tatham
0c110dcd10 Fixes for more robust handling of command-line parse errors.
[originally from svn r2236]
2002-11-20 20:09:02 +00:00
Simon Tatham
57d1921d04 Largely-placeholder man page for Plink, for the sake of not
irritating `make install'. Thanks RJK, again.

[originally from svn r2234]
2002-11-20 19:49:59 +00:00
Ben Harris
a12a78bcb9 Rename CharWidth() to char_width(). The former name clashes with an API
function in Mac OS.

[originally from svn r2205]
2002-11-09 21:46:21 +00:00
Simon Tatham
a1125a8052 Improve robustness in random seed file handling.
[originally from svn r2200]
2002-11-07 20:01:04 +00:00
Simon Tatham
a44ba79e2e Packet-level logging should now work properly in Unix Plink.
[originally from svn r2193]
2002-11-05 13:21:03 +00:00
Simon Tatham
3a084e9333 Fix command-line error handling in pterm. (Hint: wrapping a multi-
statement macro in `do ... while (0)' and putting a `continue'
within it don't go well together. Oops.)

[originally from svn r2192]
2002-11-05 13:20:42 +00:00
Simon Tatham
64e9693c4d Substitute -' (magical hyphen) for \-' (inert minus sign) in the
manpage. Fixes Debian bug #167761.

[originally from svn r2190]
2002-11-05 09:37:31 +00:00
Simon Tatham
82e447c1d0 Improve shadow bold mode: set the default shadow bold offset to +1
not -1 (it turns out _most_ X fonts prefer the former, though
irritatingly my favourite real X font used to prefer the latter
which was why I made the X version of my Font Of Choice do so too),
and also clip to the boundaries of the rectangle we should be
drawing text in. This still doesn't completely prevent display
corruption in the case where text drawn in one sweep is partially
overwritten in a future one, but gnome-terminal has this problem
too, and now we've got the right default SB offset _and_ offer the
opportunity to reconfigure it I think this is pretty good for now.

[originally from svn r2184]
2002-11-02 16:16:35 +00:00
Simon Tatham
d6739ada35 Another signal-handling refinement from RJK: the SIGCHLD handler
should be prepared to reap more than one child per invocation if
necessary, since we do after all have two.

[originally from svn r2183]
2002-11-02 16:05:26 +00:00
Simon Tatham
53eb272766 Improve the noise collection for the internal random pool.
[originally from svn r2182]
2002-11-02 15:23:20 +00:00
Simon Tatham
93e9fadc75 RJK's general signal-handling robustness patch. Should fix the weird
spin behaviour occasionally seen after pterm's child process dies.

[originally from svn r2181]
2002-11-02 14:35:57 +00:00
Simon Tatham
f7d23ae746 Prevent another segfault. Oops.
[originally from svn r2178]
2002-11-01 18:51:22 +00:00
Simon Tatham
c20ffe59a3 Add a .cvsignore for the Unix subdir
[originally from svn r2176]
2002-11-01 13:37:39 +00:00
Simon Tatham
fd3bc934d9 Improve handling of oobinline sockets; Plink in telnet mode now
doesn't hang when you hit ^C, which is nice. I think a better
solution would involve nonblocking sockets; as it stands it's a
little dependent on what may be quirks of the Linux socket layer.

[originally from svn r2175]
2002-11-01 13:36:48 +00:00
Simon Tatham
48147ab3a8 Implement access to the SSH agent. This ought to make agent
forwarding work as well, of course.

[originally from svn r2172]
2002-11-01 12:55:13 +00:00
Simon Tatham
d833765b78 Replace a \r\n with an ordinary \n - this isn't Windows!
[originally from svn r2171]
2002-11-01 12:54:51 +00:00
Simon Tatham
057eabf46d Stop the segfault on failure to resolve a host name.
[originally from svn r2170]
2002-11-01 12:54:22 +00:00
Simon Tatham
9c5fe60bfe Add a \n at the end of an error message - oops.
[originally from svn r2169]
2002-11-01 12:54:03 +00:00
Simon Tatham
317180ed49 First attempt at a Unix port of Plink. Seems to basically work;
doesn't yet use the SSH agent, no way to specify arbitrary config
options, no manpage yet, couple of other fiddly things need doing,
but it makes SSH connections and doesn't fall over horribly so I say
it's a good start. Now to run it under valgrind...

[originally from svn r2165]
2002-10-31 19:49:52 +00:00
Simon Tatham
db71c5006e RJK's `pterm --help' patch. I _must_ find a better alternative to
this init sequence - it surely can't be right that `pterm --help'
with no DISPLAY complains at the lack of DISPLAY rather than giving
a help message!

[originally from svn r2164]
2002-10-30 18:22:37 +00:00
Simon Tatham
52bdffbfe0 More preparatory work: remove the <windows.h> include from lots of
source files in which it's no longer required (it was previously
required in anything that included <putty.h>, but not any more).
Also moved a couple of stray bits of exposed WinSock back into
winnet.c (getservbyname from ssh.c and AF_INET from proxy.c).

[originally from svn r2160]
2002-10-30 17:57:31 +00:00
Simon Tatham
0720fc12ad terminal.c should call the frontend beep() routine even with
mode==BELL_VISUAL, otherwise taskbar flashing won't happen on visual
bells. It's up to the frontend routine to spot BELL_VISUAL and avoid
making any noise.

[originally from svn r2155]
2002-10-28 21:58:07 +00:00
Simon Tatham
ec5a7ee940 CloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
into line with most other xtermalikes. On Unix, the exit code of a
shell is the last exit code of one of its child processes, even if
it's an interactive shell - so some pterms will close and some will
not for no particularly good reason. Power-detaching a screen
session is especially bad for this.
COE_NORMAL is still useful for specialist purposes (running a single
command in its own pterm), but I don't think it's a sane default,
unfortunately.

[originally from svn r2154]
2002-10-28 17:39:21 +00:00
Simon Tatham
963742fd4e Fix Alt+numberpad in pterm. For a start, there was a bug whereby if
a pterm came up while Alt was down, then releasing it would cause a
^@ to be generated. Also, though, I've decided that Alt plus a
single numberpad key should not generate a low-numbered control
code, because that's too easy to do by mistake and the codes are too
powerful. Anyone who really _wants_ to create a ^C or ^D from the
numberpad can do Alt-03 or Alt-04 easily enough; two-digit codes and
more such as Alt-65 are unaffected.

[originally from svn r2153]
2002-10-28 17:34:45 +00:00
Simon Tatham
9a5939e9cf First bug discovered as a result of global-removal: pasting into
pterm caused a crash because I had the wrong prototype for the
selection_received event handler. Should be fixed.

[originally from svn r2150]
2002-10-28 09:38:28 +00:00
Simon Tatham
4756c15fc9 Yet more global-removal. The static variables in logging.c are now
absent, and also (I think) all the frontend request functions (such
as request_resize) take a context pointer, so that multiple windows
can be handled sensibly. I wouldn't swear to this, but I _think_
that only leaves the Unicode stuff as the last stubborn holdout.

[originally from svn r2147]
2002-10-26 12:58:13 +00:00
Simon Tatham
948f95d5e8 Reorganised the Unicode layer somewhat: moved luni_send and
lpage_send out into the line discipline, making them _clients_ of
the Unicode layer rather than part of it. This means they can access
ldisc->term, which in turn means I've been able to remove the
temporary global variable `term'. We're slowly getting there.

[originally from svn r2143]
2002-10-26 11:08:59 +00:00
Simon Tatham
24530b945e Port forwarding module now passes backend handles around properly.
As a result I've now been able to turn the global variables `back'
and `backhandle' into module-level statics in the individual front
ends. Now _that's_ progress!

[originally from svn r2142]
2002-10-26 10:33:59 +00:00
Simon Tatham
0b2523eeda Line discipline module now uses dynamically allocated data. Also
fixed one or two other minor problems.

[originally from svn r2141]
2002-10-26 10:16:19 +00:00
Simon Tatham
ba0468b983 Oops; remembering to call term_provide_resize_fn in the Unix front
end would probably help. Thanks Colin.

[originally from svn r2140]
2002-10-25 22:00:22 +00:00
Simon Tatham
528a826574 Fix the nasty flashing-light-grey-on-resize problem, after MCV
helpfully alerted me to the existence of gdk_window_set_background().

[originally from svn r2129]
2002-10-25 11:58:59 +00:00
Simon Tatham
6e2a0c079b pty backend now supports the changed function interface, so pterm
now compiles and runs again after the major destabilisation.
Unfortunately it wasn't feasible to actually encapsulate all of the
pty backend's data, since the utmp helper and the need to fork and
drop privileges before doing anything else at all rather confuses
matters. So the data handle passed around to the pty backend is a
null pointer, and the pty backend is just as global-ridden as it
always has been. Shame, but such is life.

[originally from svn r2128]
2002-10-25 11:50:51 +00:00
Simon Tatham
bdb47167d1 Implement handling of all Close On Exit modes. Default is to close
only on clean exit, which is a departure from most xterm-alikes but
Ian reckons people will love me for it. If this turns out to be
wrong, we can always change the default for Unix.

[originally from svn r2120]
2002-10-23 14:21:12 +00:00
Simon Tatham
a9bd716df8 Cleanups from yesterday's destabilisation: lots of stuff in
terminal.c was apparently relying on implicit initialisation to
zero, and also I've removed the backends' dependency on terminal.h
by having terminal sizes explicitly passed in to back->size().

[originally from svn r2117]
2002-10-23 12:41:35 +00:00
Simon Tatham
0a80c983e2 Major destabilisation, phase 1. In this phase I've moved (I think)
all the global and function-static variables out of terminal.c into
a dynamically allocated data structure. Note that this does not yet
confer the ability to run more than one of them in the same process,
because other things (the line discipline, the back end) are still
global, and also in particular the address of the dynamically
allocated terminal-data structure is held in a global variable
`term'. But what I've got here represents a reasonable stopping
point at which to check things in. In _theory_ this should all still
work happily, on both Unix and Windows. In practice, who knows?

[originally from svn r2115]
2002-10-22 16:11:33 +00:00
Simon Tatham
48314f7dc0 Make -ut work the right way round! :-)
[originally from svn r2114]
2002-10-22 13:27:58 +00:00
Simon Tatham
5ce13aad0f Stop `pterm -ut-' leaving the unnecessary utmp helper as a zombie
process (Debian bug #165887).

[originally from svn r2113]
2002-10-22 13:26:57 +00:00
Simon Tatham
45c494ff9d Make sure SIGINT and SIGQUIT haven't been nobbled in our child
process by weird POSIX-required shell behaviour.

[originally from svn r2110]
2002-10-21 23:01:34 +00:00
Simon Tatham
068da38044 Don't bother closing fds 0-2 before dup2ing over them; there's no
need, and it means we always have a valid open stderr.

[originally from svn r2109]
2002-10-21 23:00:18 +00:00
Simon Tatham
a14e970585 VT100 line drawing characters should only happen between 0x5F and
0x7E, not everywhere else. Silly me thought nobody would bother to
depend on this :-)

[originally from svn r2108]
2002-10-21 22:59:14 +00:00
Simon Tatham
07878d8b7c Implement Richard's really clever idea about bell overload mode:
it's automatically deactivated by any keypress, so that command-line
beeps from (e.g.) filename completion don't suddenly stop occurring,
but it still provides a rapid response to an accidental spewing of a
binary to your terminal.

[originally from svn r2107]
2002-10-20 13:23:30 +00:00
Simon Tatham
de8789b8f2 ScrollOnKey wasn't working because I failed to set seen_key_event in
pterm.c.

[originally from svn r2106]
2002-10-20 12:44:29 +00:00
Simon Tatham
a219808b15 Reject unrecognised command-line options; thanks rjk.
[originally from svn r2102]
2002-10-18 15:26:54 +00:00
Simon Tatham
14a7d67b26 Fix typo in man page. Thanks Richard.
[originally from svn r2101]
2002-10-18 10:38:22 +00:00
Simon Tatham
dc7afc9ca7 Oops - that fix wasn't _quite_ right, since it killed all
non-function keys completely :-/

[originally from svn r2096]
2002-10-17 16:58:24 +00:00
Simon Tatham
7d7b523977 Make the shadow bold offset configurable, after discovering that
7x13 goes the other way to all other X fonts I've ever seen. (Arrgh.)

[originally from svn r2095]
2002-10-17 16:51:01 +00:00
Simon Tatham
34bdd30857 This should fix the bug causing Alt-Shift to generate Escape.
[originally from svn r2093]
2002-10-17 16:45:17 +00:00
Simon Tatham
3c6a770e9f Add the -xrm command-line option, to allow specification of an
arbitrary X resource which doesn't have a dedicated command-line
option.

[originally from svn r2089]
2002-10-16 22:54:58 +00:00
Simon Tatham
e70c66b8b0 Add a man page.
[originally from svn r2088]
2002-10-16 22:43:35 +00:00
Simon Tatham
ac3d4e70ad A few more command-line options.
[originally from svn r2086]
2002-10-16 16:00:38 +00:00
Simon Tatham
1f2ee65ae9 Implement reading of X resources, and -name to change the name under
which to look them up.

[originally from svn r2084]
2002-10-16 14:32:06 +00:00
Simon Tatham
1aed45b4e1 Fix utmp and pty handling so that GTK never complains about running
set[ug]id. All privs-requiring pty operations are done at the very
start of the run, then privs are dropped before initialising GTK.
Utmp is handled by forking a still-privileged subprocess at this
point, and later asking it (through a pipe) to stamp utmp. The
subprocess cleans up utmp on exit, which has the additional
advantage that if the main pterm process suffers some sort of
unexpected termination (up to and including SIGKILL) the subprocess
can still mop up utmp.

[originally from svn r2082]
2002-10-16 12:17:51 +00:00
Simon Tatham
5bc8f34f58 Bug `shift-backspace': whichever of ^H and ^? is configured for
Backspace, Shift-Backspace should do the _other_ one. Thanks to
Justin Bradford.

[originally from svn r2079]
2002-10-16 09:40:36 +00:00
Simon Tatham
4f3806f735 Support bold-as-font, by means of a separate bold font (if one was
supplied) or shadow bolding (if not). As usual, can't yet be turned
on without a recompile.

[originally from svn r2077]
2002-10-15 18:42:48 +00:00
Simon Tatham
07a69c5245 Configure the pty so that it agrees with our idea of whether
Backspace sends ^H or ^?.

[originally from svn r2076]
2002-10-15 18:36:18 +00:00
Simon Tatham
d3983ca06b Support underline and vertical-line cursors as well as block.
[originally from svn r2075]
2002-10-15 18:18:25 +00:00
Simon Tatham
58ee7d86a6 If we can't load the specified font, give an error message rather
than segfaulting.

[originally from svn r2074]
2002-10-15 17:41:22 +00:00
Simon Tatham
12189e7193 Printer support: cfg.printer is assumed to be a Unix command through
which to pipe printed data. Of course by default printing is
disabled; typically cfg.printer would be set to `lpr', perhaps with
some arguments.

[originally from svn r2073]
2002-10-15 17:38:04 +00:00
Simon Tatham
80063aeef7 Scrollbar can now be configured to go on the left (although the
current configuration mechanism doesn't support it).

[originally from svn r2072]
2002-10-15 17:24:13 +00:00
Simon Tatham
3584334835 Support ALT + numeric keypad for typing in strange character codes.
[originally from svn r2071]
2002-10-15 17:18:24 +00:00
Simon Tatham
5b061e20cf Add newline at EOF in uxucs.c. Thanks Richard. :-)
[originally from svn r2070]
2002-10-15 16:52:45 +00:00
Simon Tatham
0fdab304de Support scrolling with the mouse wheel (X servers apparently usually
send a button 4 press for an upward wheel movement and a button 5
press for a downward one). Untested since my own trackball's button
4 does nothing obvious. Someone with a mouse wheel should give this
a workout.

[originally from svn r2069]
2002-10-15 16:50:42 +00:00
Simon Tatham
6f9ce1b724 Support for blinking text and blinking cursor. Won't actually be
accessible until there's a way to configure it on, but it worked in
tests.

[originally from svn r2067]
2002-10-15 16:38:10 +00:00
Simon Tatham
69f78385ab Use the appalling gnome-terminal hack for server-controlled resizes
rather than the gtk_window_set_policy approach; the GNOME people say
that the former is the Right Thing in spite of the latter looking
obviously plausible.

[originally from svn r2066]
2002-10-15 16:24:42 +00:00
Simon Tatham
851a376359 Remove some rogue diagnostics.
[originally from svn r2065]
2002-10-15 15:44:23 +00:00
Simon Tatham
e18cf6b714 Don't forget to initialise the pixel size parameters of the window
as passed to the pty...

[originally from svn r2064]
2002-10-15 15:16:21 +00:00
Simon Tatham
8782e6a3b0 Richard's patch to make the scrollbar configurably absent. (Still
want a new option to configure it to be on the LHS though. And some
lunatic is bound to ask for an xterm-style scrollbar too... :-)

[originally from svn r2062]
2002-10-15 14:55:19 +00:00
Simon Tatham
c15a6ada0c Support for all the server-side window configuration requests,
including server-controlled resizing. Irritatingly I've had to use a
deprecated option to gtk_window_set_policy() to make this work,
resulting in me raising GNOME bug #95818 to ask for it to be un-
deprecated again...

[originally from svn r2061]
2002-10-15 14:31:06 +00:00
Simon Tatham
0c011dcbe0 Introduce the ability to control whether the shell run in pterm is a
login shell or not. Also moved these new pieces of configuration
into the Config structure, though they won't stay there forever
since they will need to be moved out into platform-dependent config.

[originally from svn r2060]
2002-10-15 13:07:18 +00:00
Simon Tatham
0813c25bf6 Finish up utmp processing: add the -ut- command-line option to
suppress stamping it at all. (I suppose this ought to be part of the
cfg structure really.)

[originally from svn r2059]
2002-10-15 12:42:58 +00:00
Simon Tatham
6118021749 Support for utmp, wtmp and lastlog. Probably not terribly portable
as yet, but seems to work plausibly on Linux.

[originally from svn r2058]
2002-10-15 12:29:52 +00:00
Simon Tatham
cec0515b2c Support for BSD-style pty devices. Tested under Linux; might need
minor tweaks to run under other BSD-style OSes.

[originally from svn r2056]
2002-10-15 10:49:38 +00:00
Simon Tatham
b8625a2bf5 Trim wide text properly at the RH edge of the screen.
[originally from svn r2055]
2002-10-15 09:30:16 +00:00
Simon Tatham
74f8f8e8ac Support for line attributes: ESC #3, #4 and #6 for double-width and
double-height text.

[originally from svn r2054]
2002-10-15 00:22:48 +00:00
Simon Tatham
cf74237900 Don't cause the mouse pointer to reappear just because it's changed
shape.

[originally from svn r2053]
2002-10-14 23:39:07 +00:00
Simon Tatham
8bc305cafe Only engage a GTK idle function when absolutely necessary, otherwise
the whole app spins on it and takes up CPU all the time.

[originally from svn r2052]
2002-10-14 23:32:00 +00:00
Simon Tatham
7dff77fccf Set up the palette _before_ trying to paint the window black.
[originally from svn r2051]
2002-10-14 22:14:54 +00:00
Simon Tatham
1d65d8ae5f Add the -log option, which activates full session logging. Should be
handy next time I need to debug any weird terminal problems...

[originally from svn r2050]
2002-10-14 10:33:34 +00:00
Simon Tatham
6b2f5c95ab Support server requests for colour palette changes.
[originally from svn r2048]
2002-10-14 10:21:35 +00:00
Simon Tatham
a8ba9f422b Don't forget to call term_paste() when we get the chance, or big
pastes won't go through. (Not sure whether I should remove this
weird behaviour completely for pterm. It's a bit bizarre.)

[originally from svn r2047]
2002-10-14 10:14:12 +00:00
Simon Tatham
209fe88b79 Support NetHack keypad mode. :-)
[originally from svn r2046]
2002-10-14 10:06:07 +00:00
Simon Tatham
e0c7339695 Support for hiding the mouse pointer on keypresses. Currently
activated by `-hide' on the command line.

[originally from svn r2045]
2002-10-14 09:58:27 +00:00
Simon Tatham
76cda50683 xterm-class programs should exit when their primary child process
dies, rather than waiting around until the last open handle on the
pty closes.

[originally from svn r2044]
2002-10-14 09:18:34 +00:00
Simon Tatham
b3072e227e SEL_NL is different between Windows and Unix; move it out into the
platform-specific header files.

[originally from svn r2043]
2002-10-14 09:06:31 +00:00
Simon Tatham
3c3fd86691 Various faffs in the pty allocation process to get controlling
terminals right. Irritatingly this was working when run from another
[xsp]term but not when run from my GNOME panel. I think it's now
more robust.

[originally from svn r2041]
2002-10-14 08:56:55 +00:00
Simon Tatham
6758c89927 Window title configurability: -T to set it from the command line,
support for the xterm escape sequences to set it, and support for
the xterm escape sequence to query it.

[originally from svn r2040]
2002-10-14 00:05:37 +00:00
Simon Tatham
598018644a Don't forget to set $TERM when we spawn the pty. Of course I haven't
noticed this until now because I've always been spawning it _from_
another xterm! :-)

[originally from svn r2039]
2002-10-13 23:57:40 +00:00
Simon Tatham
e6d2d5260f gnome-terminal insists on receiving the selection as COMPOUND_TEXT
rather than STRING, so we can now supply that too. Pasting both ways
between pterm and gnome-terminal now works.

[originally from svn r2038]
2002-10-13 23:48:31 +00:00
Simon Tatham
bacc5cf102 Added two simple command-line arguments: -fn (so I can have my Font
Of Choice back :-) and -e to run a command other than $SHELL.

[originally from svn r2037]
2002-10-13 12:54:17 +00:00
Simon Tatham
0dff7f90da Resizing of pterm now works, and the size information is correctly
sent on to the pty.

[originally from svn r2036]
2002-10-13 12:44:01 +00:00
Simon Tatham
504c198e73 Deal with the appalling mouse pointer colours. (Why doesn't GTK let
us select our own mouse pointer fg and bg for standard pointers?
It's ludicrous that we can only do it for pixmap-derived ones. :-( )

[originally from svn r2035]
2002-10-13 12:17:03 +00:00
Simon Tatham
b4cf83ed6b Shift-Ins pastes.
[originally from svn r2034]
2002-10-13 11:27:39 +00:00
Simon Tatham
ffff6f32c7 Selection now supported in pterm. Required small modifications
outside the unix subdir, owing to more things needing to become
platform-dependent.

[originally from svn r2033]
2002-10-13 11:24:25 +00:00
Simon Tatham
b65b4e36f5 Fix underline, which I cleverly broke while adding support for the
window border. Oops.

[originally from svn r2032]
2002-10-13 09:57:07 +00:00
Simon Tatham
534c8b4c4a Scrollbar now exists and functions; so do Shift-PgUp / Shift-PgDn.
[originally from svn r2031]
2002-10-13 09:54:36 +00:00
Simon Tatham
5aee6cf2af Stop hard-coding a nonstandard font. We now default to `fixed', and
pick up the font's real width and height. This means I now _can't_
use my font of choice until I implement some command-line options; I
wonder what feature will appear next :-)

[originally from svn r2027]
2002-10-10 14:42:56 +00:00
Simon Tatham
33a54aaa8a And that's it! pty.c is now a real pty backend rather than a
loopback interface; pterm now runs $SHELL and gives every impression
of being not a bad terminal emulator. I'm quite pleased with that. :-)

[originally from svn r2015]
2002-10-10 12:40:05 +00:00
Simon Tatham
77096ce405 Half-decent keyboard handling for pterm. Not very well done - it
would have been better to abstract the general key-handling rules
away from the platform-specific keysyms rather than doing clone-
and-hack as I've done - but it'll serve for now. Now all I need is a
real pty back end and pterm should be a just-about-usable prototype.

[originally from svn r2013]
2002-10-10 12:14:05 +00:00
Simon Tatham
77a43c5d7a Temporary hack which makes vt100 line drawing work in the prototype
pterm.

[originally from svn r2012]
2002-10-10 11:33:46 +00:00
Simon Tatham
622f9b44f0 A sensible minimum of do_text() and do_cursor() is now implemented.
This means pterm actually _looks_ like the PuTTY terminal emulator
engine, instead of merely giving evidence to the expert eye that
said engine is hidden in there somewhere :-)

[originally from svn r2011]
2002-10-10 10:40:30 +00:00
Simon Tatham
6d0e9b205d First phase of porting. pterm now compiles and runs under Linux+gtk.
The current pty.c backend is temporarily a loopback device for
terminal emulator testing, the display handling is only just enough
to show that terminal.c is functioning, the keyboard handling is
laughable, and most features are absent. Next step: bring output and
input up to a plausibly working state, and put a real pty on the
back to create a vaguely usable prototype. Oh, and a scrollbar would
be nice too.
In _theory_ the Windows builds should still work fine after this...

[originally from svn r2010]
2002-10-09 18:09:42 +00:00
Simon Tatham
64c52b0d30 Begin destabilisation in the wake of 0.53! This checkin contains the
beginning of a Unix port. It's nowhere near done, and currently it
won't even compile on Unix. But this represents the start of the
process of separating out platform-specific code, and also contains
the mkfiles.pl changes required to support a Unix makefile and a
non-flat source tree.

[originally from svn r1993]
2002-10-07 16:45:23 +00:00