static char sccsid
[] = "@(#)wwenviron.c 3.15 %G%";
* Copyright (c) 1983 Regents of the University of California,
* All rights reserved. Redistribution permitted subject to
* the terms of the Berkeley Software License Agreement.
* Set up the environment of this process to run in window 'wp'.
if ((i
= open("/dev/tty", 0)) < 0)
if (ioctl(i
, TIOCNOTTY
, (char *)0) < 0)
if ((i
= wp
->ww_socket
) < 0 && (i
= open(wp
->ww_ttyname
, 2)) < 0)
for (i
= wwdtablesize
- 1; i
> 2; i
--)
(void) ioctl(0, TIOCSPGRP
, (char *)&pgrp
);
(void) setpgrp(pgrp
, pgrp
);
(void) signal(SIGPIPE
, SIG_DFL
);
(void) sprintf(wwwintermcap
, "TERMCAP=%sco#%d:li#%d:%s%s%s%s%s%s%s",
WWT_TERMCAP
, wp
->ww_w
.nc
, wp
->ww_w
.nr
,
wwavailmodes
& WWM_REV
? WWT_REV
: "",
wwavailmodes
& WWM_BLK
? WWT_BLK
: "",
wwavailmodes
& WWM_UL
? WWT_UL
: "",
wwavailmodes
& WWM_GRP
? WWT_GRP
: "",
wwavailmodes
& WWM_DIM
? WWT_DIM
: "",
wwavailmodes
& WWM_USR
? WWT_USR
: "",