Simon Tatham [Mon, 28 Oct 2002 09:38:28 +0000 (09:38 +0000)]
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.
Simon Tatham [Sat, 26 Oct 2002 12:58:13 +0000 (12:58 +0000)]
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.
Simon Tatham [Sat, 26 Oct 2002 11:08:59 +0000 (11:08 +0000)]
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.
Simon Tatham [Sat, 26 Oct 2002 10:33:59 +0000 (10:33 +0000)]
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!
Simon Tatham [Fri, 25 Oct 2002 11:50:51 +0000 (11:50 +0000)]
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.
Simon Tatham [Fri, 25 Oct 2002 11:30:33 +0000 (11:30 +0000)]
Major destabilisation, phase 2. This time it's the backends' turn:
each backend now stores all its internal variables in a big struct,
and each backend function gets a pointer to this struct passed to
it. This still isn't the end of the work - lots of subsidiary things
still use globals, notably all the cipher and compressor modules and
the X11 forwarding authentication stuff. But ssh.c itself has now
been transformed, and that was the really painful bit, so from here
on it all ought to be a sequence of much smaller and simpler pieces
of work.
Jacob Nevins [Wed, 23 Oct 2002 14:24:40 +0000 (14:24 +0000)]
Minor compiler nits:
- use smalloc/sfree, not malloc/free
- include <ctype.h>
- include <string.h> (although this doesn't shut the compiler up about
non-ANSI stricmp/strnicmp)
Simon Tatham [Wed, 23 Oct 2002 14:21:12 +0000 (14:21 +0000)]
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.
Simon Tatham [Wed, 23 Oct 2002 12:41:35 +0000 (12:41 +0000)]
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().
Simon Tatham [Tue, 22 Oct 2002 16:11:33 +0000 (16:11 +0000)]
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?
Simon Tatham [Tue, 22 Oct 2002 10:31:23 +0000 (10:31 +0000)]
Thanks to Richard B for pointing out that xterm has its own variants
of the alternate-screen and save-cursor control sequences, with
subtly different semantics and entertaining interactions with the
usual ones. No thanks to xterm for doing so in the first place :-(
This checkin should sort it all out.
Simon Tatham [Mon, 21 Oct 2002 22:59:14 +0000 (22:59 +0000)]
VT100 line drawing characters should only happen between 0x5F and
0x7E, not everywhere else. Silly me thought nobody would bother to
depend on this :-)
Simon Tatham [Sun, 20 Oct 2002 13:23:30 +0000 (13:23 +0000)]
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.
Simon Tatham [Wed, 16 Oct 2002 16:32:17 +0000 (16:32 +0000)]
Temporarily change the default for cut-and-paste of line drawing
characters, under Unix only, because the stub Unicode layer makes
the usual default break moderately painfully.
Simon Tatham [Wed, 16 Oct 2002 12:30:51 +0000 (12:30 +0000)]
Add a file to the source archive mentioning the version number of
the latest release. This is so that .tar.gz snapshots for the Unix
port can be versioned as `0.53-20021016' or similar, meaning that
(e.g.) Debian version numbering can be monotonic between releases
and snapshots.
Simon Tatham [Wed, 16 Oct 2002 12:17:51 +0000 (12:17 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 18:42:48 +0000 (18:42 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 17:38:04 +0000 (17:38 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 16:50:42 +0000 (16:50 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 16:24:42 +0000 (16:24 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 14:55:19 +0000 (14:55 +0000)]
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... :-)
Simon Tatham [Tue, 15 Oct 2002 14:31:06 +0000 (14:31 +0000)]
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...
Simon Tatham [Tue, 15 Oct 2002 13:07:18 +0000 (13:07 +0000)]
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.
Simon Tatham [Tue, 15 Oct 2002 12:42:58 +0000 (12:42 +0000)]
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.)
Simon Tatham [Mon, 14 Oct 2002 10:14:12 +0000 (10:14 +0000)]
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.)
Simon Tatham [Mon, 14 Oct 2002 08:56:55 +0000 (08:56 +0000)]
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.
Simon Tatham [Mon, 14 Oct 2002 00:05:37 +0000 (00:05 +0000)]
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.
Simon Tatham [Sun, 13 Oct 2002 23:57:40 +0000 (23:57 +0000)]
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! :-)
Simon Tatham [Sun, 13 Oct 2002 23:48:31 +0000 (23:48 +0000)]
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.
Simon Tatham [Sun, 13 Oct 2002 12:17:03 +0000 (12:17 +0000)]
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. :-( )