1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

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]
This commit is contained in:
Simon Tatham
2002-10-13 12:54:17 +00:00
parent 0dff7f90da
commit bacc5cf102
2 changed files with 31 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#endif
int pty_master_fd;
char **pty_argv;
static void pty_size(void);
@ -87,11 +88,14 @@ static char *pty_init(char *host, int port, char **realhost, int nodelay)
dup2(slavefd, 2);
setsid();
setpgrp();
tcsetpgrp(0, getpgrp());
tcsetpgrp(slavefd, getpgrp());
/* Close everything _else_, for tidiness. */
for (i = 3; i < 1024; i++)
close(i);
execl(getenv("SHELL"), getenv("SHELL"), NULL);
if (pty_argv)
execvp(pty_argv[0], pty_argv);
else
execl(getenv("SHELL"), getenv("SHELL"), NULL);
/*
* If we're here, exec has gone badly foom.
*/