static char *sccsid
= "@(#)main.c 3.6 83/08/25";
int nbufline
= 48; /* compatible */
#define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage()))
struct timezone timezone
;
if (p
= rindex(*argv
, '/'))
debug
= strcmp(p
, "a.out") == 0;
if ((shell
= getenv("SHELL")) == 0)
if (shellname
= rindex(shell
, '/'))
(void) gettimeofday(&starttime
, &timezone
);
(void) fprintf(stderr
, "Can't do windows on this terminal.\n");
wwnewtty
.ww_tchars
.t_quitc
= wwoldtty
.ww_tchars
.t_quitc
;
(void) wwsettty(0, &wwnewtty
);
if ((cmdwin
= wwopen(WWO_REVERSE
, 1, wwncol
, 0, 0, 0)) == 0) {
(void) fprintf(stderr
, "Can't open command window.\r\n");
if ((framewin
= wwopen(WWO_GLASS
|WWO_FRAME
, wwnrow
, wwncol
, 0, 0, 0))
(void) fprintf(stderr
, "Can't open frame window.\r\n");
wwadd(framewin
, &wwhead
);
if ((boxwin
= wwopen(WWO_GLASS
, wwnrow
, wwncol
, 0, 0, 0)) == 0) {
(void) fprintf(stderr
, "Can't open box window.\r\n");
(void) signal(SIGCHLD
, wwchild
);
if (dflag
|| doconfig() < 0)
* Loop until we get some keyboard input.
while (wwforce(&imask
) < 0)
if ((imask
& 1 << 0) == 0)
if ((ibufc
= read(0, ibuf
, sizeof ibuf
)) < 0) {
* Weird loop. Copy the buffer to the pty
* and stopping on the escape character
* in a hopefully efficient way.
* Probably a good thing to make ibufc == 1 a special
for (p
= ibufp
, n
= ibufc
;;) {
(void) write(curwin
->ww_pty
, ibufp
, ibufc
);
} else if (*p
++ == escapec
) {
(void) write(curwin
->ww_pty
,
(void) fprintf(stderr
, "window: [-e escape-char] [-t] [-f] [-d]\n");