mirror of
https://github.com/ksherlock/marlene.git
synced 2024-09-13 00:55:06 +00:00
(re)set the controlling terminal.
This is necessary to read input from the console (via the Event Manager) since opening a pseudo terminal screws up the controlling terminal (and there is no O_NOCTTY flag).
This commit is contained in:
parent
d77291a0c0
commit
4da75367c1
@ -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 $@
|
||||
|
||||
|
||||
|
||||
|
10
darlene.c
10
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(;;) {
|
||||
|
Loading…
Reference in New Issue
Block a user