diff --git a/GNUmakefile b/GNUmakefile index 687224b..58b1758 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -19,7 +19,7 @@ marlene: $(MARLENE_OBJS) $(COMMON_OBJS) darlene: $(DARLENE_OBJS) $(COMMON_OBJS) $(CC) -lutil -o $@ $^ - iix chtyp -a 0xdc00 $@ +# iix chtyp -a 0xdc00 $@ diff --git a/darlene.c b/darlene.c index b4c1c1d..b1544c6 100644 --- a/darlene.c +++ b/darlene.c @@ -192,6 +192,11 @@ int main(int argc, char **argv) { return 1; } + if (!isatty(STDIN_FILENO)) { + ErrWriteCString("stdin required.\r\n"); + return 1; + } + term_var.value = "\x05\x00vt100"; child_argv = NULL; for (i = 1; i < argc; ++i) { @@ -260,6 +265,11 @@ int main(int argc, char **argv) { goto _exit; } + /* reset the controlling terminal, which was clobbered by opening a pty */ + /* standard TIOCSCTTY causes ORCA/C shift errors */ + #undef TIOCSCTTY + #define TIOCSCTTY (0x20000000ul | ('t' << 8) | 97) + ioctl(STDIN_FILENO, TIOCSCTTY, (void *)0); for(;;) {