aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/9term.c32
-rw-r--r--src/cmd/9term/SunOS.c19
-rw-r--r--src/cmd/9term/rcstart.c7
-rw-r--r--src/cmd/9term/win.c4
4 files changed, 48 insertions, 14 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c
index 50c0cfc9..f84ead25 100644
--- a/src/cmd/9term/9term.c
+++ b/src/cmd/9term/9term.c
@@ -214,7 +214,7 @@ threadmain(int argc, char *argv[])
if(maxtab <= 0)
maxtab = 8;
- initdraw(nil, nil, "9term");
+ initdraw(0, nil, "9term");
notify(hangupnote);
mc = initmouse(nil, screen);
@@ -299,13 +299,27 @@ loop(void)
{
Rune r;
int i;
- Alt a[] = {
- {mc->c, &mc->m, CHANRCV},
- {kc->c, &r, CHANRCV},
- {hostc, &i, CHANRCV},
- {mc->resizec, nil, CHANRCV},
- {nil, nil, CHANEND},
- };
+ Alt a[5];
+
+ a[0].c = mc->c;
+ a[0].v = &mc->m;
+ a[0].op = CHANRCV;
+
+ a[1].c = kc->c;
+ a[1].v = &r;
+ a[1].op = CHANRCV;
+
+ a[2].c = hostc;
+ a[2].v = &i;
+ a[2].op = CHANRCV;
+
+ a[3].c = mc->resizec;
+ a[3].v = nil;
+ a[3].op = CHANRCV;
+
+ a[4].c = nil;
+ a[4].v = nil;
+ a[4].op = CHANEND;
for(;;) {
tcheck();
@@ -326,7 +340,7 @@ loop(void)
key(r);
break;
case 2:
- conswrite(rcbuf[i].data, rcbuf[i].n);
+ conswrite((char*)rcbuf[i].data, rcbuf[i].n);
break;
case 3:
doreshape();
diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c
index d7db9fc5..d9104ed7 100644
--- a/src/cmd/9term/SunOS.c
+++ b/src/cmd/9term/SunOS.c
@@ -1,6 +1,8 @@
-#include "9term.h"
+#include <u.h>
#include <termios.h>
#include <sys/termios.h>
+#include <libc.h>
+#include "term.h"
int
getpts(int fd[], char *slave)
@@ -14,6 +16,19 @@ getpts(int fd[], char *slave)
return 0;
}
+int
+childpty(int fd[], char *slave)
+{
+ int sfd;
+
+ close(fd[1]);
+ setsid();
+ sfd = open(slave, ORDWR);
+ if(sfd < 0)
+ sysfatal("open %s: %r\n", slave);
+ return sfd;
+}
+
struct winsize ows;
void
@@ -26,7 +41,7 @@ updatewinsize(int row, int col, int dx, int dy)
ws.ws_xpixel = dx;
ws.ws_ypixel = dy;
if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col)
- if(ioctl(rcfd[0], TIOCSWINSZ, &ws) < 0)
+ if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0)
fprint(2, "ioctl: %r\n");
ows = ws;
}
diff --git a/src/cmd/9term/rcstart.c b/src/cmd/9term/rcstart.c
index df187827..a6a72fe6 100644
--- a/src/cmd/9term/rcstart.c
+++ b/src/cmd/9term/rcstart.c
@@ -35,7 +35,12 @@ rcstart(int argc, char **argv, int *pfd)
dup(sfd, 0);
dup(sfd, 1);
dup(sfd, 2);
- system("stty tabs -onlcr -echo erase ^h intr ^?");
+// system("stty tabs -onlcr -echo erase '^h' intr '^?'");
+ system("echo tabs; stty tabs");
+ system("echo onlcr; stty -onlcr");
+ system("echo echo; stty -echo");
+ system("echo erase; stty erase '^h'");
+ system("echo intr; stty intr '^?'");
execvp(argv[0], argv);
fprint(2, "exec %s failed: %r\n", argv[0]);
_exits("oops");
diff --git a/src/cmd/9term/win.c b/src/cmd/9term/win.c
index 95d84a32..d1fc5e1c 100644
--- a/src/cmd/9term/win.c
+++ b/src/cmd/9term/win.c
@@ -133,10 +133,10 @@ threadmain(int argc, char **argv)
name = "gnot";
threadnotify(nopipes, 1);
- if((fs = nsmount("acme", "")) < 0)
+ if((fs = nsmount("acme", "")) == 0)
sysfatal("nsmount acme: %r");
ctlfd = fsopen(fs, "new/ctl", ORDWR|OCEXEC);
- if(ctlfd < 0 || fsread(ctlfd, buf, 12) != 12)
+ if(ctlfd == 0 || fsread(ctlfd, buf, 12) != 12)
sysfatal("ctl: %r");
id = atoi(buf);
sprint(buf, "%d/tag", id);