History of unix/uxpty.c of 7b85fe471f0de8fa

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of file unix/uxpty.c at check-in 7b85fe471f0de8fa

2013-11-17
08:05
Fix an assortment of dupprintf() format string bugs. I've enabled gcc's format-string checking on dupprintf, by declaring it in misc.h to have the appropriate GNU-specific attribute. This pointed out a selection of warnings, which I've fixed. file: [cca2fb52ab] check-in: [44f33ce7e0] user: simon branch: trunk, size: 30173
2013-07-21
02:40
When I turned fcntls into noncloexecs in r9940, I missed one. file: [bfe3c96ee9] check-in: [c138704d7f] user: simon branch: trunk, size: 30178
2013-07-19
13:10
Centralise calls to fcntl into functions that carefully check the error returns. file: [c2636dfa5a] check-in: [04c7a24906] user: simon branch: trunk, size: 30214
12:44
Add a missing error check in pterm's child-process setup. Shouldn't really fail, but might as well be careful. file: [8970481265] check-in: [e86c47be22] user: simon branch: trunk, size: 30418
2013-07-11
12:24
Fix a pty-freeing error which caused a segfault if you attempted to use Restart Session in a post-not-close-on-exit pterm. file: [3d1ae4ae10] check-in: [c15206d980] user: simon branch: trunk, size: 30324
2013-07-01
12:56
A collection of small bug fixes from Chris West, apparently spotted by Coverity: assorted language-use goofs like freeing the wrong thing or forgetting to initialise a string on all code paths. file: [a95b7cf52e] check-in: [8962699297] user: simon branch: trunk, size: 30057
2013-02-24
13:28
Remove the half-hearted attempt to make the utmp helper process drop privileges just before dying of a fatal signal. I'm not sure what I intended it for in the first place; it certainly isn't doing its job properly (no setgid), it's causing compiler warnings due to not checking the setuid return code, and we can't think of any useful purpose for it. file: [0dccf1a336] check-in: [9613910863] user: simon branch: trunk, size: 30026
2013-02-23
15:00
Don't forget to check the return values of setuid and friends. file: [d04a91249e] check-in: [37c4284d89] user: simon branch: trunk, size: 30048
2012-12-18
03:19
Switch round a bogus if statement I've just noticed. Both the write to pty_utmp_helper_pipe _and_ the close of it if we're not going to write should be conditionalised on the pipe existing, rather than just the former! file: [a2002f98aa] check-in: [21f0ce4047] user: simon branch: trunk, size: 29758
03:02
Patch from Brad Smith to use posix_openpt() instead of open("/dev/ptmx"), where the former is available. Improves portability, since at least one OS (OpenBSD) supports the POSIX pty functions but does it via an underlying mechanism which doesn't involving having a /dev/ptmx. file: [09dc480b3c] check-in: [ab7860768b] user: simon branch: trunk, size: 29522
03:02
Use O_NOCTTY (if available) when opening /dev/ptmx, just in case any OS doesn't automatically assume it. (It would seem faintly weird to me - surely opening the master end of a given pty is a fairly good indication that you're _not_ a process running inside it which wants to have it available as /dev/tty! But you never know...) file: [0720d9fce7] check-in: [66ab5269a3] user: simon branch: trunk, size: 29370
2012-07-11
13:12
If pterm's execvp fails when given the whole argument list after -e, and the argument list contains only one string, try again by passing that single string to "$SHELL -c" to be parsed as a shell command. This matches xterm's behaviour (as of xterm 261, at least), and means in practice that users can do _either_ of 'pterm -e some command' and 'pterm -e "some command"'. (A quick survey suggests that the majority of X terminal programs agree with pterm's old behaviour of only supporting '-e some command', except that gnome-terminal only supports the other behaviour and xterm supports both. With that disagreement, I think supporting both is probably the sensible thing.) file: [31b294db2f] check-in: [6530f824ce] user: simon branch: trunk, size: 29288
2011-09-19
11:38
We shouldn't fork off a utmp helper subprocess when we aren't setuid, because (a) under that circumstance we won't be writing to utmp anyway, and (b) if we aren't setuid, then we won't have created the pty at the point we fork, so even if our subprocess _could_ have written to utmp it wouldn't have done it right! Spotted by valgrind (triggering on the access beyond the end of the ttyname string in setup_utmp, clueing me in to it having been empty). file: [fa5104a1f5] check-in: [acb21a748a] user: simon branch: trunk, size: 27773
2011-07-14
13:52
Post-release destabilisation! Completely remove the struct type 'Config' in putty.h, which stores all PuTTY's settings and includes an arbitrary length limit on every single one of those settings which is stored in string form. In place of it is 'Conf', an opaque data type everywhere outside the new file conf.c, which stores a list of (key, value) pairs in which every key contains an integer identifying a configuration setting, and for some of those integers the key also contains extra parts (so that, for instance, CONF_environmt is a string-to-string mapping). Everywhere that a Config was previously used, a Conf is now; everywhere there was a Config structure copy, conf_copy() is called; every lookup, adjustment, load and save operation on a Config has been rewritten; and there's a mechanism for serialising a Conf into a binary blob and back for use with Duplicate Session. User-visible effects of this change _should_ be minimal, though I don't doubt I've introduced one or two bugs here and there which will eventually be found. The _intended_ visible effects of this change are that all arbitrary limits on configuration strings and lists (e.g. limit on number of port forwardings) should now disappear; that list boxes in the configuration will now be displayed in a sorted order rather than the arbitrary order in which they were added to the list (since the underlying data structure is now a sorted tree234 rather than an ad-hoc comma-separated string); and one more specific change, which is that local and dynamic port forwardings on the same port number are now mutually exclusive in the configuration (putting 'D' in the key rather than the value was a mistake in the first place). One other reorganisation as a result of this is that I've moved all the dialog.c standard handlers (dlg_stdeditbox_handler and friends) out into config.c, because I can't really justify calling them generic any more. When they took a pointer to an arbitrary structure type and the offset of a field within that structure, they were independent of whether that structure was a Config or something completely different, but now they really do expect to talk to a Conf, which can _only_ be used for PuTTY configuration, so I've renamed them all things like conf_editbox_handler and moved them out of the nominally independent dialog-box management module into the PuTTY-specific config.c. file: [116018d6b1] check-in: [a2c0243430] user: simon branch: trunk, size: 26697
2011-03-02
13:12
Colin Watson reports that gnome-session has been known to leave SIGPIPE ignored in its child processes, leading to unexpected behaviour inside pterms. (The gnome-session I'm sitting in front of doesn't seem to do this as far as I can tell, but I don't doubt there are some that do.) Add SIGPIPE to the list of signals we reset to default behaviour before launching pterm's child process. file: [ce2a2f8e82] check-in: [c736ac142e] user: simon branch: trunk, size: 26575
2011-03-01
17:00
Use pid_t more consistently. Should shut up a warning from GCC 4.6, and may conceivably help on platforms where int and pid_t aren't sufficiently similar. file: [e17ee8f7dc] check-in: [5b7da77997] user: jacob branch: trunk, size: 26522
2009-08-06
19:19
Workarounds for compiling with -D_FORTIFY_SOURCE=2 (as Ubuntu does), which doesn't like you to ignore the return value from read()/write()/etc (and apparently can't be shut up with a cast to void). file: [b42e718b24] check-in: [c1918bea98] user: jacob branch: trunk, size: 26531
2007-10-02
16:07
As far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent, except that O_NONBLOCK is standardised and FIONBIO isn't. In consequence, replace our only use of FIONBIO with O_NONBLOCK. Inspired by Jonathan H N Chin, who had problems with this on Solaris. file: [bdb3540503] check-in: [8b7c139db9] user: ben branch: trunk, size: 26451
2007-07-01
10:47
Implement Marcin Bulandra's suggestion of only automatically updating the port number in the GUI when the connection type is changed if the current port number is the standard one for the current protocol. It's not perfect, but it should make the common case of tabbing through the Session panel easier when starting non-SSH connections on odd ports. file: [b2775501ad] check-in: [7db7c53371] user: jacob branch: trunk, size: 26369
2007-06-30
16:56
Rationalise access to, and content of, backends[] array. Should be no significant change in behaviour. (Well, entering usernames containing commas on Plink's command line will be a little harder now.) file: [7b78b04474] check-in: [8b1d299a90] user: jacob branch: trunk, size: 26369
2007-02-05
14:14
Ahem; other half of r7232... file: [50d2f09734] check-in: [6f2b9734d1] user: simon branch: trunk, size: 26350
14:04
When calling TIOCSCTTY, it helps to pass it an fd that's still open, instead of one we closed two lines earlier. I apparently broke this in r7107. file: [ea95096f6a] check-in: [4b39592852] user: simon branch: trunk, size: 26356
2007-01-14
07:44
Remove the loops that close all open fds before running a subprocess. They were intended to make sure the child process didn't inherit anything embarrassing or inconvenient from us, such as the master end of its own pty, but now we instead do this by making sure to set all our own fds to not-FD_CLOEXEC on creation. This should fix Debian bug #357520. (This doesn't seem to work _quite_ right in uxproxy.c's invocation of a local proxy command: both ends of a GTK internal pipe end up in the child process's fd space. This appears to be another GTK 1 bug, inasmuch as it goes away when I build with Colin's preliminary GTK 2 patch; for the moment I think leaving that pipe lying around is probably less harmful than hampering the proxy process's ability to use extra fds by prior arrangement with PuTTY's parent process.) file: [446b9eafd2] check-in: [5efc5c6876] user: simon branch: trunk, size: 26362
2006-12-09
09:44
Set FD_CLOEXEC in a little convenience function that does the right thing with F_GETFD and F_SETFD. file: [7914114831] check-in: [7af697811b] user: ben branch: trunk, size: 26318
2006-11-23
08:32
I've just discovered that using the saved sessions menu from Unix PuTTY causes the child process to inherit a lot of socket fds from its parent, which is a pain if one of them then ends up holding open a listening socket which the parent was using for port forwarding after the parent itself is dead. Therefore, this checkin sprinkles FD_CLOEXEC throughout the Unix platform directory wherever there looks like being a long-lived fd. file: [f3667395ba] check-in: [1002c29630] user: simon branch: trunk, size: 26375
2006-08-27
03:03
The `socket' function in the backends is only ever checked to see if it's NULL. Since we already have one back end (uxpty) which doesn't in fact talk to a network socket, and may well have more soon, I'm replacing this TCP/IP-centric function with a nice neutral `connected' function returning a boolean. Nothing else about its semantics has currently changed. file: [03a93dabca] check-in: [32affe9699] user: simon branch: trunk, size: 26202
2006-05-12
06:02
pty_init should put _something_ into realhost file: [d3e2d64cc4] check-in: [d92da8d7b9] user: owen branch: trunk, size: 26238
2006-02-23
07:38
Do proper select-for-write on ptys. Currently, pasting a sufficiently large string into pterm in any circumstances in which it's echoed back to the terminal will cause a deadlock once the pty's write buffer fills up. file: [fb4ec99bd9] check-in: [f7782e75bd] user: simon branch: trunk, size: 26204
2005-09-13
14:57
Some hosts don't have TIOCSCTTY. Don't try to use it on them. Patch from Mike Protts. file: [99d07fada6] check-in: [6da243c989] user: ben branch: trunk, size: 25062
2005-07-15
06:47
Patch from Colin Watson: we were sometimes passing stack storage to putenv(), which is Bad (in his case, it caused TERM to end up unset). Use malloc()'d storage instead. file: [2ffc882694] check-in: [d0c607099f] user: jacob branch: trunk, size: 25038
2005-05-09
08:27
Make Makefile.gtk build again on Linux (assume <utmpx.h>). file: [667e81c4e3] check-in: [298c44bd3c] user: jacob branch: trunk, size: 24890
2005-04-25
18:28
Use pututxline() in place of pututline(), since the former is standardised by X/Open and actually seems to be more common (NetBSD has it). Also use updwtmpx() rather than directly writing to the wtmpx file, though more for reasons of aesthetics than anything practical. file: [ef73a9f0bf] check-in: [abb9ed30fb] user: ben branch: trunk, size: 24892
12:21
uxpty.c uses non-X/Open facilities (notably strsignal()), so don't define _XOPEN_SOURCE. We do still need _GNU_SOURCE in order to get grantpt() on GNU systems. This allows uxpty.c to compile on NetBSD. file: [496076ffb0] check-in: [43bdc0d3b5] user: ben branch: trunk, size: 24903
2005-04-04
08:44
NULL needs to be cast to void * when passed to a variadic function like execl(). Spotted by Damien Miller. file: [c7c04cc8de] check-in: [eb7b985525] user: ben branch: trunk, size: 24960
2005-02-06
09:52
Reinstate the broken -e option in pterm. Also I've just worked out a much better way of handling pty_argv which doesn't require uxpty.c to be linked in to Unix PuTTY and PuTTYtel. file: [6be3c5c3d6] check-in: [0632fdc578] user: simon branch: trunk, size: 24952
09:14
Encapsulated most of the pty backend's variables into a proper data structure, in preparation for wanting more than one of them in a single process. This can't be done cleanly, because the whole business with pty_pre_init pre-allocating the pty rather assumes we want a known number of the things before we drop privileges; so there's a horrid hack to make pty_pre_init work on platforms that have at most one pty instance per process, but at the same time things ought to work sensibly with more than one per process _if_ pty_pre_init isn't required. file: [1e7754cff3] check-in: [df1c22fdcb] user: simon branch: trunk, size: 24970
07:33
The pty backend won't _always_ be running under X, so it should be possible to compile it without the WINDOWID variable. file: [ed8b92e470] check-in: [7b85fe471f] user: simon branch: trunk, size: 21149
2005-02-05
09:33
When allocating BSD-style ptys, we should not be satisfied with a /dev/ptyXX we can open: we must also check that we can open and use the corresponding /dev/ttyXX, because if it's been left in the wrong mode then we will look terribly silly when we fork and _then_ discover our pty is unusable. file: [76b034dd83] check-in: [04b0d0c117] user: simon branch: trunk, size: 20924
2004-12-31
07:02
Renamed unix/pty.c → unix/uxpty.c. 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. file: [1a1b07fa1d] check-in: [afc775a19a] user: simon branch: trunk, size: 20301
2004-12-30
11:29
If we're going to define _XOPEN_SOURCE, we should at least define it to a version that includes putenv(). Make it 600 (the current one) for good measure. file: [1a1b07fa1d] check-in: [a7dc2dc328] user: ben branch: trunk, size: 20301
2004-12-29
06:32
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. file: [6b4b6f4978] check-in: [8cec6d493a] user: simon branch: trunk, size: 20297
2004-12-17
08:25
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. file: [77366d9cfb] check-in: [e6e6127715] user: simon branch: trunk, size: 20222
03:43
Apparently SIGCHLD is blocked by default in processes run in a pterm, which was breaking my bash job notification patch. This is apparently not the case for xterm, so I've fiddled with it. Not entirely sure _why_ it did this in the first place, but there we go. file: [67f1dc94cb] check-in: [1d52612956] user: simon branch: trunk, size: 20328
2004-11-27
07:20
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). file: [5e9b5333ab] check-in: [683ee6bed3] user: simon branch: trunk, size: 20125
2004-11-24
05:42
I think rjk meant `setpgid', not `setpgrp'. file: [5113de05aa] check-in: [ef747fcdbc] user: simon branch: trunk, size: 20089
05:36
RJK's OS X portability patch: - initialise blank mbstate_t using memset rather than an ad-hoc initialiser. - expand the OMIT_UTMP ifdefs to enclose a load of entire functions that would generate `static function never called' warnings if left as empty shells. - couple of other fiddly things. file: [1a4a7cf0fd] check-in: [d8510637ed] user: simon branch: trunk, size: 20089
2004-10-16
05:56
Moved the environment variables config block out of the Telnet panel into the Connection panel, and implemented support for the SSH2 "env" request. (I haven't yet found a server which accepts this request, so although I've visually checked the packet log and it looks OK, I haven't yet been able to do a full end-to-end test.) Also, the `pty' backend reads this data and does a series of `putenv' commands before launching the shell or application. This is mostly because in last week's UTF-8 faffings I got thoroughly sick of typing `export LANG=en_GB.UTF-8' every time I started a new testing pterm, and it suddenly occurred to me that this would be precisely the sort of thing you'd want to have pterm set up for you, particularly since you can configure it alongside the translation settings and so you can ensure they match up properly. file: [4af232b592] check-in: [a859123a17] user: simon branch: trunk, size: 20018
2004-08-16
04:38
Patch from Kurt Roeckx: apparently on Debian amd64, the ut_time member of struct utmp is not equivalent to time_t (it's 32-bit). From Debian bug#265910. file: [ae6d1868f8] check-in: [73d18097ab] user: jacob branch: trunk, size: 19529
2004-06-20
12:07
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. file: [09f1114af4] check-in: [d6cbea6730] user: jacob branch: trunk, size: 19278
2003-05-11
07:28
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. file: [c7c5b64821] check-in: [3000ac05c2] user: simon branch: trunk, size: 19256
2003-05-04
09:18
Colin's const-fixing Patch Of Death. Seems to build fine on Windows as well as Unix, so it can go in. file: [e88f1974b2] check-in: [c9f1945192] user: simon branch: trunk, size: 19131
2003-04-12
03:27
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. file: [c99359ea35] check-in: [ab6d1303e3] user: simon branch: trunk, size: 19126
2003-04-04
14:21
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(). file: [999b1bbfdc] check-in: [53746610b8] user: simon branch: trunk, size: 18944
2003-03-29
13:52
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! file: [18c2534c9e] check-in: [c069c8a0c8] user: simon branch: trunk, size: 18516
12:30
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... file: [bba6899eb8] check-in: [b384cf23f7] user: simon branch: trunk, size: 18491
10:14
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. file: [e873616820] check-in: [48c3c19745] user: simon branch: trunk, size: 15515
2003-03-06
06:57
Richard B's patch to add WINDOWID support to pterm. file: [bc89ad212c] check-in: [5bae12ff10] user: simon branch: trunk, size: 15511
2003-01-20
14:10
Add a stub "free" routine for pterm. Thanks to rjk. file: [f3f2e764d6] check-in: [25b133ff45] user: ben branch: trunk, size: 15321
2003-01-12
08:48
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.) file: [84250b6468] check-in: [f4d72755c1] user: simon branch: trunk, size: 15220
2002-11-02
10:05
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. file: [7fa93fca98] check-in: [66d4a347b6] user: simon branch: trunk, size: 15048
08:35
RJK's general signal-handling robustness patch. Should fix the weird spin behaviour occasionally seen after pterm's child process dies. file: [0d20ecce41] check-in: [e1fb5ab154] user: simon branch: trunk, size: 15018
2002-10-26
07:58
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. file: [371397351a] check-in: [8fba443d8c] user: simon branch: trunk, size: 14792
05:16
Line discipline module now uses dynamically allocated data. Also fixed one or two other minor problems. file: [fcae57a961] check-in: [d16199ae68] user: simon branch: trunk, size: 14580
2002-10-25
06:50
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. file: [e62e5d4c67] check-in: [feb8faf680] user: simon branch: trunk, size: 14469
2002-10-23
09:21
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. file: [86e255c2ee] check-in: [e33f2e8338] user: simon branch: trunk, size: 13726
07:41
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(). file: [3b3c176f0b] check-in: [4bdb37398f] user: simon branch: trunk, size: 13414
2002-10-22
11:11
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? file: [5af59ddf84] check-in: [c56a5fa8ee] user: simon branch: trunk, size: 13260
08:26
Stop `pterm -ut-' leaving the unnecessary utmp helper as a zombie process (Debian bug #165887). file: [827bbbe4fb] check-in: [9a67f6a55f] user: simon branch: trunk, size: 13190
2002-10-21
18:01
Make sure SIGINT and SIGQUIT haven't been nobbled in our child process by weird POSIX-required shell behaviour. file: [a7c62ec031] check-in: [179d3e66f2] user: simon branch: trunk, size: 13155
18:00
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. file: [1a2f5bd014] check-in: [e44f39631e] user: simon branch: trunk, size: 12912
2002-10-16
07:17
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. file: [7068ffe502] check-in: [7f9a81d03e] user: simon branch: trunk, size: 12945
2002-10-15
13:36
Configure the pty so that it agrees with our idea of whether Backspace sends ^H or ^?. file: [325188697d] check-in: [8a75f4f208] user: simon branch: trunk, size: 10065
10:16
Don't forget to initialise the pixel size parameters of the window as passed to the pty... file: [6f26c1a3c8] check-in: [f47218505b] user: simon branch: trunk, size: 9772
08:07
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. file: [a4f47e0136] check-in: [889a957cfd] user: simon branch: trunk, size: 9644
07:42
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.) file: [9135d47ea2] check-in: [48d2913a94] user: simon branch: trunk, size: 9421
07:29
Support for utmp, wtmp and lastlog. Probably not terribly portable as yet, but seems to work plausibly on Linux. file: [4511574823] check-in: [04380af359] user: simon branch: trunk, size: 8716
05:49
Support for BSD-style pty devices. Tested under Linux; might need minor tweaks to run under other BSD-style OSes. file: [83f84a530b] check-in: [29530e8f6a] user: simon branch: trunk, size: 5001
2002-10-14
04:18
xterm-class programs should exit when their primary child process dies, rather than waiting around until the last open handle on the pty closes. file: [ba3da51d17] check-in: [fe669158ac] user: simon branch: trunk, size: 3966
03:56
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. file: [f6a0a62880] check-in: [ed8734df95] user: simon branch: trunk, size: 3479
2002-10-13
18:57
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! :-) file: [ec71a86921] check-in: [d49f2941d0] user: simon branch: trunk, size: 3384
07:54
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. file: [f19288a400] check-in: [7a2269ba51] user: simon branch: trunk, size: 3247
07:44
Resizing of pterm now works, and the size information is correctly sent on to the pty. file: [7bb2d18722] check-in: [2fb4abdb44] user: simon branch: trunk, size: 3163
2002-10-10
07:40
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. :-) file: [7675decb45] check-in: [df838b2e56] user: simon branch: trunk, size: 3064
2002-10-09
13:09
Added: 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... file: [99b4295079] check-in: [2d8039929a] user: simon branch: trunk, size: 1679