Anonymous avatar Anonymous committed 3d8a1b5

Various fixes.

Comments (0)

Files changed (1)

src/cmd/9term/9term.c

 Rectangle	scrollr;	/* scroll bar rectangle */
 Rectangle	lastsr;		/* used for scroll bar */
 int		holdon;		/* hold mode */
-int		rawon(void);		/* raw mode */
+int		rawon;		/* raw mode */
 int		scrolling;	/* window scrolls */
 int		clickmsec;	/* time of last click */
 uint		clickq0;	/* point of last click */
 void
 usage(void)
 {
-	fprint(2, "usage: 9term [-a] [-s] [cmd ...]\n");
+	fprint(2, "usage: 9term [-ars] [cmd ...]\n");
 	threadexitsall("usage");
 }
 
 	case 'a':	/* acme mode */
 		button2exec++;
 		break;
+	case 'r':
+		/* not clear this is useful */
+		rawon = 1;
+		break;
 	case 's':
 		scrolling++;
 		break;
 	proccreate(hostproc, hostc, 32*1024);
 }
 
-int crawon = -1;
-
-int
-rawon(void)
-{
-	if(crawon != -1)
-		return crawon;
-	return 0;
-}
-
 void
 loop(void)
 {
 		a[2].op = CHANRCV;
 		if(!scrolling && t.qh > t.org+t.f->nchars)
 			a[2].op = CHANNOP;;
-		crawon = -1;
 		switch(alt(a)) {
 		default:
 			fatal("impossible");
 	if (ptinrect(t.m.xy, scrollr)) {
 		scroll(but);
 		if(t.qh<=t.org+t.f->nchars)
-			consread();;
+			consread();
 		return;
 	}
 		
 		return;
 	}
 
-	if(rawon() && t.q0==t.nr){
+	if(rawon && t.q0==t.nr){
 		addraw(&r, 1);
+		consread();
 		return;
 	}
 
 	if(holdon)
 		return 0;
 
-	if(rawon()) 
+fprint(2, "consready? %d %d\n", rawon, t.nraw);
+	if(rawon) 
 		return t.nraw != 0;
 
 	/* look to see if there is a complete line */
 			c = *p;
 			p += width;
 			n -= width;
-			if(!rawon() && (c == '\n' || c == '\004'))
+			if(!rawon && (c == '\n' || c == '\004'))
 				break;
 		}
 		/* take out control-d when not doing a zero length write */
 	uint m;
 	uint q0;
 
-	if(rawon() && t.q0==t.nr){
+	if(rawon && t.q0==t.nr){
 		addraw(r, n);
 		return;
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.