diff --git a/sys/src/cmd/hmi/console/console.h b/sys/src/cmd/hmi/console/console.h index 305c914..13cf443 100644 --- a/sys/src/cmd/hmi/console/console.h +++ b/sys/src/cmd/hmi/console/console.h @@ -1,7 +1,7 @@ /* * This file is part of Jehanne. * - * Copyright (C) 2015 Giacomo Tesio + * Copyright (C) 2015-2018 Giacomo Tesio * * Jehanne is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ extern int systemwide; /* all the system depend on this console: extern int blind; /* no feedback for input, disables rawmode */ extern int linecontrol; extern int crnl; /* turn \n into \r\n to output device */ +extern int posix; /* Qcons name is "tty" instead of "cons" */ extern int debugging; extern void enabledebug(const char *); diff --git a/sys/src/cmd/hmi/console/pipeconsole.c b/sys/src/cmd/hmi/console/pipeconsole.c index 736defd..fcd0b10 100644 --- a/sys/src/cmd/hmi/console/pipeconsole.c +++ b/sys/src/cmd/hmi/console/pipeconsole.c @@ -1,7 +1,7 @@ /* * This file is part of Jehanne. * - * Copyright (C) 2015 Giacomo Tesio + * Copyright (C) 2015-2018 Giacomo Tesio * * Jehanne is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ int crnl; static void usage(void) { - fprint(2, "usage: %s [-d dbgfile] [-l] [-b] program [args]\n", argv0); + fprint(2, "usage: %s [-d dbgfile] [-l] [-b] [-P] program [args]\n", argv0); exits("usage"); } void @@ -48,6 +48,9 @@ main(int argc, char *argv[]) case 'l': linecontrol = 0; break; + case 'P': + posix = 1; + break; default: usage(); }ARGEND; @@ -66,10 +69,15 @@ main(int argc, char *argv[]) /* become the requested program */ rfork(RFNOTEG|RFREND|RFCFDG); - fd = open("/dev/cons", OREAD); - fd = open("/dev/cons", OWRITE); + if(posix){ + fd = open("/dev/tty", OREAD); + fd = open("/dev/tty", OWRITE); + } else { + fd = open("/dev/cons", OREAD); + fd = open("/dev/cons", OWRITE); + } if(dup(fd, 2) != 2) sysfatal("bad FDs: %r"); - exec(argv[0], argv); + jehanne_pexec(argv[0], argv); sysfatal("exec %s: %r", argv[0]); } diff --git a/sys/src/cmd/hmi/console/serve9p.c b/sys/src/cmd/hmi/console/serve9p.c index 1a41b61..e09f58a 100644 --- a/sys/src/cmd/hmi/console/serve9p.c +++ b/sys/src/cmd/hmi/console/serve9p.c @@ -1,7 +1,7 @@ /* * This file is part of Jehanne. * - * Copyright (C) 2015 Giacomo Tesio + * Copyright (C) 2015-2018 Giacomo Tesio * * Jehanne is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ typedef enum } Status; int systemwide; +int posix; static Status status; static int rawmode; @@ -1015,6 +1016,9 @@ fsserve(int connection) Fcall rep; Fcall *req; + if(posix) + qtab[Qcons].name = "tty"; + fspid = getpid(); req = malloc(sizeof(Fcall)+Maxfdata); if(req == nil)