jfmxl | 29 May 08:32 2016

rio on plan 9 from user space

On another tack ... I have installed plan 9 from user space on my debian 
machine, and sam and acme seem to open and work ok. But when I type rio, 
I get ...

$ rio
rio: it looks like there's already a window manager running;  rio not 
started

So, rio under plan 9 from user space (p9port?) wants the the whole 
display?

I cannot run xfce and have rio in a window?

I am trying to communicate with a plan 9 cpu, but drawterm seems slow 
and awkward.

Are there any plan 9 installations open to people like myself to 'try 
out'?

Roswell Grey | 28 May 22:18 2016
Picon

Plan 9 article in hacker magazine!

2600 is a hacker's quarterly magazine that specializes in sharing subtle tips and tricks related to computer hacking. Volume 33, issue 1, however, featured something that was pleasent to read: an article on Plan 9. It describes what it is, how it came to be, how it differs from other OS's, and how to get it. It's a basic introduction to 9 that most of us already know about, but nonetheless I wanted to share it with you all to show that there's still a very strong interest in the OS. And with this article, perhaps it'll gain a little more! Thanks for reading. Definitely pick up a copy of 2600 if you have the chance!

Dave MacFarlane | 28 May 19:23 2016
Picon

More about /dev/draw

Either I'm going insane, the default Plan 9 /dev/draw in-memory implementation
doesn't implement draw(3), or possibly both.

When I do the following, it works as expected under both drawterm and a locally mounted instance:
1. Allocate a screen with an 'A' message
2. Allocate an image on the screen of the same size as /dev/wctl  with a 'b' message
3. Draw the image over the window with a 'd' message
4. Flush the buffer with 'v'

When I do the following, it works under drawterm, but not with a local /dev/draw implementation:
Steps 1-2 above
3. Allocate another image of some arbitrary fill colour with 'b' (with or without the repl bit)
4a. (Optional, doesn't seem to make a difference) set the compositing operator with 'O'
4b. Draw the new image over a portion of the window image from step 2 with 'd'
5. Go to step 3-4 from the first variation.

(I don't have a 9front instance to test on.)

On the other hand, replacing a portion of the image from step 2 with 'y' works under either. (I haven't gotten around to using 'Y' when appropriate yet.)


to work under drawterm.

The end result is that under a local Plan 9 instance the basic sample shiny test looks like this:


Instead of this:


Does anyone have any pointers? I don't have much access to a physical Plan 9 machine, so I'm having trouble debugging this since it works under drawterm (or perhaps is buggy under drawterm in a way that makes it seem like it's working..)

It would also potentially be helpful if someone who uses Go under 9front could let me know how x/exp/shiny/examples/basic looks with the shiny driver in that branch, but I'm not sure that it matters since it'll most likely be the same as one of the above..

- Dave
trebol55555 | 27 May 19:11 2016
Picon

Chords, ^, _, ^B and scroll with mouse wheel in p9p sam

flselect() must be changed in samterm/flayer.c to get the double click
selection working ok.

Anyone has hacked sam to use both the plumber and the pipe?

trebol.

diff -rpuN src/cmd/sam/cmd.c sam/cmd.c
--- src/cmd/sam/cmd.c	2016-04-18 19:07:22.000000000 +0100
+++ sam/cmd.c	2016-05-25 23:56:34.040909362 +0100
 <at>  <at>  -35,6 +35,8  <at>  <at>  struct cmdtab cmdtab[]={
 	'>',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'<',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'|',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
+	'^',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
+	'_',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'=',	0,	0,	0,	0,	aDot,	0,	linex,	eq_cmd,
 	'c'|0x100,0,	0,	0,	0,	aNo,	0,	wordx,	cd_cmd,
 	0,	0,	0,	0,	0,	0,	0,	0
 <at>  <at>  -76,7 +78,13  <at>  <at>  inputc(void)

     Again:
 	nbuf = 0;
-	if(downloaded){
+	if(cmdbufpos > cmdbuf.nc && cmdbuf.nc > 0){
+		cmdbufpos = 0;
+		bufreset(&cmdbuf);
+	}
+	if(cmdbufpos < cmdbuf.nc && cmdbuf.nc > 0)
+		bufread(&cmdbuf, cmdbufpos++, &r, 1);
+	else if(downloaded){
 		while(termoutp == terminp){
 			cmdupdate();
 			if(patset)
diff -rpuN src/cmd/sam/sam.h sam/sam.h
--- src/cmd/sam/sam.h	2016-04-18 19:07:22.000000000 +0100
+++ sam/sam.h	2016-05-25 23:45:05.652931784 +0100
 <at>  <at>  -369,6 +369,8  <at>  <at>  extern int	quitok;
 extern Address	addr;
 extern Buffer	snarfbuf;
 extern Buffer	plan9buf;
+extern Buffer	cmdbuf;
+extern int	cmdbufpos;
 extern List	file;
 extern List	tempfile;
 extern File	*cmd;
diff -rpuN src/cmd/sam/shell.c sam/shell.c
--- src/cmd/sam/shell.c	2016-04-18 19:07:22.000000000 +0100
+++ sam/shell.c	2016-05-25 23:46:25.262692361 +0100
 <at>  <at>  -6,6 +6,8  <at>  <at>  extern	jmp_buf	mainloop;
 char	errfile[64];
 String	plan9cmd;	/* null terminated */
 Buffer	plan9buf;
+Buffer	cmdbuf;
+int	cmdbufpos;
 void	checkerrs(void);

 void
 <at>  <at>  -40,7 +42,7  <at>  <at>  plan9(File *f, int type, String *s, int
 	}
 	if(type!='!' && pipe(pipe1)==-1)
 		error(Epipe);
-	if(type=='|')
+	if(type=='|' || type=='_')
 		snarf(f, addr.r.p1, addr.r.p2, &plan9buf, 1);
 	if((pid=fork()) == 0){
 		setname(f);
 <at>  <at>  -61,14 +63,14  <at>  <at>  plan9(File *f, int type, String *s, int
 			}
 		}
 		if(type != '!') {
-			if(type=='<' || type=='|')
-				dup(pipe1[1], 1);
-			else if(type == '>')
+			if(type == '>')
 				dup(pipe1[0], 0);
+			else
+				dup(pipe1[1], 1);
 			close(pipe1[0]);
 			close(pipe1[1]);
 		}
-		if(type == '|'){
+		if(type == '|' || type == '_'){
 			if(pipe(pipe2) == -1)
 				exits("pipe");
 			if((pid = fork())==0){
 <at>  <at>  -100,7 +102,7  <at>  <at>  plan9(File *f, int type, String *s, int
 			close(pipe2[0]);
 			close(pipe2[1]);
 		}
-		if(type=='<'){
+		if(type=='<' || type=='^'){
 			close(0);	/* so it won't read from terminal */
 			open("/dev/null", 0);
 		}
 <at>  <at>  -128,9 +130,14  <at>  <at>  plan9(File *f, int type, String *s, int
 		writeio(f);
 		bpipeok = 0;
 		closeio((Posn)-1);
+	}else if(type == '^' || type == '_'){
+		int nulls;
+		close(pipe1[1]);
+		bufload(&cmdbuf, cmdbufpos, pipe1[0], &nulls);
+		close(pipe1[0]);
 	}
 	retcode = waitfor(pid);
-	if(type=='|' || type=='<')
+	if(type=='|' || type=='<' || type=='_' || type=='^')
 		if(retcode!=0)
 			warn(Wbadstatus);
 	if(downloaded)
diff -rpuN src/cmd/samterm/main.c samterm/main.c
--- src/cmd/samterm/main.c	2016-04-18 19:07:22.000000000 +0100
+++ samterm/main.c	2016-05-26 16:12:12.452556184 +0100
 <at>  <at>  -23,11 +23,8  <at>  <at>  long	modified = 0;		/* strange lookahead
 char	hostlock = 1;
 char	hasunlocked = 0;
 int	maxtab = 8;
-int	chord;
 int	autoindent;

-#define chording 0	/* code here for reference but it causes deadlocks */
-
 void
 notifyf(void *a, char *msg)
 {
 <at>  <at>  -39,7 +36,7  <at>  <at>  notifyf(void *a, char *msg)
 void
 threadmain(int argc, char *argv[])
 {
-	int i, got, scr, w;
+	int i, got, scr, chord, w;
 	Text *t;
 	Rectangle r;
 	Flayer *nwhich;
 <at>  <at>  -85,6 +82,7  <at>  <at>  threadmain(int argc, char *argv[])

 	got = 0;
 	if(protodebug) print("loop\n");
+	chord = 0;
 	for(;;got = waitforio()){
 		if(hasunlocked && RESIZED())
 			resize();
 <at>  <at>  -108,19 +106,32  <at>  <at>  threadmain(int argc, char *argv[])
 				continue;
 			}
 			nwhich = flwhich(mousep->xy);
-			scr = which && ptinrect(mousep->xy, which->scroll);
+			scr = which && (ptinrect(mousep->xy, which->scroll) ||
+				mousep->buttons&(8|16));
 			if(mousep->buttons)
 				flushtyping(1);
-			if(chording && chord==1 && !mousep->buttons)
+			if((mousep->buttons&1)==0)
 				chord = 0;
-			if(chording && chord)
+			if(chord && which && which==nwhich){
 				chord |= mousep->buttons;
-			else if(mousep->buttons&1){
+				t = (Text *)which->user1;
+				if(!t->lock){
+					w = which-t-≥l;
+					if(chord&2){
+						cut(t, w, 1, 1);
+						chord &= ~2;
+					}
+					if(chord&4){
+						paste(t, w);
+						chord &= ~4;
+					}
+				}
+			}else if(mousep->buttons&(1|8)){
 				if(nwhich){
 					if(nwhich!=which)
 						current(nwhich);
 					else if(scr)
-						scroll(which, 1);
+						scroll(which, (mousep->buttons&8) ? 4 : 1);
 					else{
 						t=(Text *)which->user1;
 						if(flselect(which)){
 <at>  <at>  -137,27 +148,14  <at>  <at>  threadmain(int argc, char *argv[])
 					scroll(which, 2);
 				else
 					menu2hit();
-			}else if((mousep->buttons&4)){
+			}else if(mousep->buttons&(4|16)){
 				if(scr)
-					scroll(which, 3);
+					scroll(which, (mousep->buttons&16) ? 5 : 3);
 				else
 					menu3hit();
 			}
 			mouseunblock();
 		}
-		if(chording && chord){
-			t = (Text*)which->user1;
-			if(!t->lock && !hostlock){
-				w = which-t-≥l;
-				if(chord&2){
-					cut(t, w, 1, 1);
-					chord &= ~2;
-				}else if(chord&4){
-					paste(t, w);
-					chord &= ~4;
-				}
-			}
-		}
 	}
 }

 <at>  <at>  -497,6 +495,7  <at>  <at>  flushtyping(int clearesc)
 #define	CUT	(Kcmd+'x')
 #define	COPY	(Kcmd+'c')
 #define	PASTE	(Kcmd+'v')
+#define	Kstx	0x02

 int
 nontypingkey(int c)
 <at>  <at>  -512,6 +511,7  <at>  <at>  nontypingkey(int c)
 	case PAGEUP:
 	case RIGHTARROW:
 	case SCROLLKEY:
+	case Kstx:
 		return 1;
 	}
 	if(c >= Kcmd)
 <at>  <at>  -669,6 +669,15  <at>  <at>  type(Flayer *l, int res)	/* what a blood
 				}
 			}
 		}
+	}else if(c == Kstx){
+		t = &cmd;
+		for(l=t->l; l->textfn==0; l++)
+			;
+		current(l);
+		flushtyping(0);
+		a = t->rasp.nrunes;
+		flsetselect(l, a, a);
+		center(l, a);
 	}else{
 		if(c==ESC && typeesc>=0){
 			l->p0 = typeesc;
diff -rpuN src/cmd/samterm/scroll.c samterm/scroll.c
--- src/cmd/samterm/scroll.c	2016-04-18 19:07:22.000000000 +0100
+++ samterm/scroll.c	2016-05-26 02:07:31.922977720 +0100
 <at>  <at>  -115,7 +115,7  <at>  <at>  scroll(Flayer *l, int but)
 	draw(scrback, Rect(0,0,Dx(l->scroll), Dy(l->scroll)), l->f.b, nil, l->scroll.min);
 	do{
 		oin = in;
-		in = abs(x-mousep-≥xy.x)<=FLSCROLLWID(l)/2;
+		in = (but > 3) || (but == 2) || abs(x-mousep-≥xy.x)<=FLSCROLLWID(l)/2;
 		if(oin && !in)
 			scrunmark(l, r);
 		if(in){
 <at>  <at>  -126,9 +126,7  <at>  <at>  scroll(Flayer *l, int but)
 				my = s.min.y;
 			if(my >= s.max.y)
 				my = s.max.y;
-			if(!eqpt(mousep->xy, Pt(x, my)))
-				moveto(mousectl, Pt(x, my));
-			if(but == 1){
+			if(but == 1 || but == 4){
 				p0 = l->origin-frcharofpt(&l->f, Pt(s.max.x, my));
 				rt = scrpos(l->scroll, p0, p0+l->f.nchars, tot);
 				y = rt.min.y;
 <at>  <at>  -136,7 +134,7  <at>  <at>  scroll(Flayer *l, int but)
 				y = my;
 				if(y > s.max.y-2)
 					y = s.max.y-2;
-			}else if(but == 3){
+			}else if(but == 3 || but == 5){
 				p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, my));
 				rt = scrpos(l->scroll, p0, p0+l->f.nchars, tot);
 				y = rt.min.y;
 <at>  <at>  -147,19 +145,21  <at>  <at>  scroll(Flayer *l, int but)
 				scrmark(l, r);
 			}
 		}
-	}while(button(but));
+	}while(but <= 3 && button(but));
 	if(in){
 		h = s.max.y-s.min.y;
 		scrunmark(l, r);
 		p0 = 0;
-		if(but == 1)
+		if(but == 1 || but == 4){
+			but = 1;
 			p0 = (long)(my-s.min.y)/l->f.font->height+1;
-		else if(but == 2){
+		}else if(but == 2){
 			if(tot > 1024L*1024L)
 				p0 = ((tot>>10)*(y-s.min.y)/h)<<10;
 			else
 				p0 = tot*(y-s.min.y)/h;
-		}else if(but == 3){
+		}else if(but == 3 || but == 5){
+			but = 3;
 			p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, my));
 			if(p0 > tot)
 				p0 = tot;
diff -rpuN src/cmd/samterm/flayer.c samterm/flayer.c
--- src/cmd/samterm/flayer.c	2016-05-27 17:46:30.431425669 +0100
+++ samterm/flayer.c	2016-04-18 19:07:22.000000000 +0100
 <at>  <at>  -254,21 +254,18  <at>  <at>  fldelete(Flayer *l, long p0, long p1)
 int
 flselect(Flayer *l)
 {
-	int ret;
 	if(l->visible!=All)
 		flupfront(l);
-	frselect(&l->f, mousectl);
-	ret = 0;
-	if(l->f.p0==l->f.p1){
-		if(mousep->msec-l-≥click<Clicktime && l->f.p0+l->origin==l->p0){
-			ret = 1;
+	if(l->f.p0==l->f.p1)
+		if(mousep->msec-l-≥click<Clicktime && l->f.p0+l->origin==l->p0 && 
+			l->f.p0==frcharofpt(&l->f, mousep->xy)){
 			l->click = 0;
-		}else
-			l->click = mousep->msec;
-	}else
-		l->click = 0;
+			return 1;
+		}
+	l->click = mousep->msec;
+	frselect(&l->f, mousectl);
 	l->p0 = l->f.p0+l->origin, l->p1 = l->f.p1+l->origin;
-	return ret;
+	return 0;
 }

 void

trebol55555 | 27 May 00:03 2016
Picon

Chords, ^, _, ^B and scroll with mouse wheel in p9p sam

The 9front sam in 

	https://bitbucket.org/kremlin_/front9port
	https://bitbucket.org/iru/sam9f-unix
	
doesn't exchange the snarf buffer with X, and the pipe in /srv doesn't
work.

This diff will makes the minimal changes to have those features of 9front
sam in the last p9p. The code fell off from the front.

trebol.

diff -rpuN src/cmd/sam/cmd.c sam/cmd.c
--- src/cmd/sam/cmd.c	2016-04-18 19:07:22.000000000 +0100
+++ sam/cmd.c	2016-05-25 23:56:34.040909362 +0100
 <at>  <at>  -35,6 +35,8  <at>  <at>  struct cmdtab cmdtab[]={
 	'>',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'<',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'|',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
+	'^',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
+	'_',	0,	0,	0,	0,	aDot,	0,	linex,	plan9_cmd,
 	'=',	0,	0,	0,	0,	aDot,	0,	linex,	eq_cmd,
 	'c'|0x100,0,	0,	0,	0,	aNo,	0,	wordx,	cd_cmd,
 	0,	0,	0,	0,	0,	0,	0,	0
 <at>  <at>  -76,7 +78,13  <at>  <at>  inputc(void)

     Again:
 	nbuf = 0;
-	if(downloaded){
+	if(cmdbufpos > cmdbuf.nc && cmdbuf.nc > 0){
+		cmdbufpos = 0;
+		bufreset(&cmdbuf);
+	}
+	if(cmdbufpos < cmdbuf.nc && cmdbuf.nc > 0)
+		bufread(&cmdbuf, cmdbufpos++, &r, 1);
+	else if(downloaded){
 		while(termoutp == terminp){
 			cmdupdate();
 			if(patset)
diff -rpuN src/cmd/sam/sam.h sam/sam.h
--- src/cmd/sam/sam.h	2016-04-18 19:07:22.000000000 +0100
+++ sam/sam.h	2016-05-25 23:45:05.652931784 +0100
 <at>  <at>  -369,6 +369,8  <at>  <at>  extern int	quitok;
 extern Address	addr;
 extern Buffer	snarfbuf;
 extern Buffer	plan9buf;
+extern Buffer	cmdbuf;
+extern int	cmdbufpos;
 extern List	file;
 extern List	tempfile;
 extern File	*cmd;
diff -rpuN src/cmd/sam/shell.c sam/shell.c
--- src/cmd/sam/shell.c	2016-04-18 19:07:22.000000000 +0100
+++ sam/shell.c	2016-05-25 23:46:25.262692361 +0100
 <at>  <at>  -6,6 +6,8  <at>  <at>  extern	jmp_buf	mainloop;
 char	errfile[64];
 String	plan9cmd;	/* null terminated */
 Buffer	plan9buf;
+Buffer	cmdbuf;
+int	cmdbufpos;
 void	checkerrs(void);

 void
 <at>  <at>  -40,7 +42,7  <at>  <at>  plan9(File *f, int type, String *s, int
 	}
 	if(type!='!' && pipe(pipe1)==-1)
 		error(Epipe);
-	if(type=='|')
+	if(type=='|' || type=='_')
 		snarf(f, addr.r.p1, addr.r.p2, &plan9buf, 1);
 	if((pid=fork()) == 0){
 		setname(f);
 <at>  <at>  -61,14 +63,14  <at>  <at>  plan9(File *f, int type, String *s, int
 			}
 		}
 		if(type != '!') {
-			if(type=='<' || type=='|')
-				dup(pipe1[1], 1);
-			else if(type == '>')
+			if(type == '>')
 				dup(pipe1[0], 0);
+			else
+				dup(pipe1[1], 1);
 			close(pipe1[0]);
 			close(pipe1[1]);
 		}
-		if(type == '|'){
+		if(type == '|' || type == '_'){
 			if(pipe(pipe2) == -1)
 				exits("pipe");
 			if((pid = fork())==0){
 <at>  <at>  -100,7 +102,7  <at>  <at>  plan9(File *f, int type, String *s, int
 			close(pipe2[0]);
 			close(pipe2[1]);
 		}
-		if(type=='<'){
+		if(type=='<' || type=='^'){
 			close(0);	/* so it won't read from terminal */
 			open("/dev/null", 0);
 		}
 <at>  <at>  -128,9 +130,14  <at>  <at>  plan9(File *f, int type, String *s, int
 		writeio(f);
 		bpipeok = 0;
 		closeio((Posn)-1);
+	}else if(type == '^' || type == '_'){
+		int nulls;
+		close(pipe1[1]);
+		bufload(&cmdbuf, cmdbufpos, pipe1[0], &nulls);
+		close(pipe1[0]);
 	}
 	retcode = waitfor(pid);
-	if(type=='|' || type=='<')
+	if(type=='|' || type=='<' || type=='_' || type=='^')
 		if(retcode!=0)
 			warn(Wbadstatus);
 	if(downloaded)
diff -rpuN src/cmd/samterm/main.c samterm/main.c
--- src/cmd/samterm/main.c	2016-04-18 19:07:22.000000000 +0100
+++ samterm/main.c	2016-05-26 16:12:12.452556184 +0100
 <at>  <at>  -23,11 +23,8  <at>  <at>  long	modified = 0;		/* strange lookahead
 char	hostlock = 1;
 char	hasunlocked = 0;
 int	maxtab = 8;
-int	chord;
 int	autoindent;

-#define chording 0	/* code here for reference but it causes deadlocks */
-
 void
 notifyf(void *a, char *msg)
 {
 <at>  <at>  -39,7 +36,7  <at>  <at>  notifyf(void *a, char *msg)
 void
 threadmain(int argc, char *argv[])
 {
-	int i, got, scr, w;
+	int i, got, scr, chord, w;
 	Text *t;
 	Rectangle r;
 	Flayer *nwhich;
 <at>  <at>  -85,6 +82,7  <at>  <at>  threadmain(int argc, char *argv[])

 	got = 0;
 	if(protodebug) print("loop\n");
+	chord = 0;
 	for(;;got = waitforio()){
 		if(hasunlocked && RESIZED())
 			resize();
 <at>  <at>  -108,19 +106,32  <at>  <at>  threadmain(int argc, char *argv[])
 				continue;
 			}
 			nwhich = flwhich(mousep->xy);
-			scr = which && ptinrect(mousep->xy, which->scroll);
+			scr = which && (ptinrect(mousep->xy, which->scroll) ||
+				mousep->buttons&(8|16));
 			if(mousep->buttons)
 				flushtyping(1);
-			if(chording && chord==1 && !mousep->buttons)
+			if((mousep->buttons&1)==0)
 				chord = 0;
-			if(chording && chord)
+			if(chord && which && which==nwhich){
 				chord |= mousep->buttons;
-			else if(mousep->buttons&1){
+				t = (Text *)which->user1;
+				if(!t->lock){
+					w = which-t-≥l;
+					if(chord&2){
+						cut(t, w, 1, 1);
+						chord &= ~2;
+					}
+					if(chord&4){
+						paste(t, w);
+						chord &= ~4;
+					}
+				}
+			}else if(mousep->buttons&(1|8)){
 				if(nwhich){
 					if(nwhich!=which)
 						current(nwhich);
 					else if(scr)
-						scroll(which, 1);
+						scroll(which, (mousep->buttons&8) ? 4 : 1);
 					else{
 						t=(Text *)which->user1;
 						if(flselect(which)){
 <at>  <at>  -137,27 +148,14  <at>  <at>  threadmain(int argc, char *argv[])
 					scroll(which, 2);
 				else
 					menu2hit();
-			}else if((mousep->buttons&4)){
+			}else if(mousep->buttons&(4|16)){
 				if(scr)
-					scroll(which, 3);
+					scroll(which, (mousep->buttons&16) ? 5 : 3);
 				else
 					menu3hit();
 			}
 			mouseunblock();
 		}
-		if(chording && chord){
-			t = (Text*)which->user1;
-			if(!t->lock && !hostlock){
-				w = which-t-≥l;
-				if(chord&2){
-					cut(t, w, 1, 1);
-					chord &= ~2;
-				}else if(chord&4){
-					paste(t, w);
-					chord &= ~4;
-				}
-			}
-		}
 	}
 }

 <at>  <at>  -497,6 +495,7  <at>  <at>  flushtyping(int clearesc)
 #define	CUT	(Kcmd+'x')
 #define	COPY	(Kcmd+'c')
 #define	PASTE	(Kcmd+'v')
+#define	Kstx	0x02

 int
 nontypingkey(int c)
 <at>  <at>  -512,6 +511,7  <at>  <at>  nontypingkey(int c)
 	case PAGEUP:
 	case RIGHTARROW:
 	case SCROLLKEY:
+	case Kstx:
 		return 1;
 	}
 	if(c >= Kcmd)
 <at>  <at>  -669,6 +669,15  <at>  <at>  type(Flayer *l, int res)	/* what a blood
 				}
 			}
 		}
+	}else if(c == Kstx){
+		t = &cmd;
+		for(l=t->l; l->textfn==0; l++)
+			;
+		current(l);
+		flushtyping(0);
+		a = t->rasp.nrunes;
+		flsetselect(l, a, a);
+		center(l, a);
 	}else{
 		if(c==ESC && typeesc>=0){
 			l->p0 = typeesc;
diff -rpuN src/cmd/samterm/scroll.c samterm/scroll.c
--- src/cmd/samterm/scroll.c	2016-04-18 19:07:22.000000000 +0100
+++ samterm/scroll.c	2016-05-26 02:07:31.922977720 +0100
 <at>  <at>  -115,7 +115,7  <at>  <at>  scroll(Flayer *l, int but)
 	draw(scrback, Rect(0,0,Dx(l->scroll), Dy(l->scroll)), l->f.b, nil, l->scroll.min);
 	do{
 		oin = in;
-		in = abs(x-mousep-≥xy.x)<=FLSCROLLWID(l)/2;
+		in = (but > 3) || (but == 2) || abs(x-mousep-≥xy.x)<=FLSCROLLWID(l)/2;
 		if(oin && !in)
 			scrunmark(l, r);
 		if(in){
 <at>  <at>  -126,9 +126,7  <at>  <at>  scroll(Flayer *l, int but)
 				my = s.min.y;
 			if(my >= s.max.y)
 				my = s.max.y;
-			if(!eqpt(mousep->xy, Pt(x, my)))
-				moveto(mousectl, Pt(x, my));
-			if(but == 1){
+			if(but == 1 || but == 4){
 				p0 = l->origin-frcharofpt(&l->f, Pt(s.max.x, my));
 				rt = scrpos(l->scroll, p0, p0+l->f.nchars, tot);
 				y = rt.min.y;
 <at>  <at>  -136,7 +134,7  <at>  <at>  scroll(Flayer *l, int but)
 				y = my;
 				if(y > s.max.y-2)
 					y = s.max.y-2;
-			}else if(but == 3){
+			}else if(but == 3 || but == 5){
 				p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, my));
 				rt = scrpos(l->scroll, p0, p0+l->f.nchars, tot);
 				y = rt.min.y;
 <at>  <at>  -147,19 +145,21  <at>  <at>  scroll(Flayer *l, int but)
 				scrmark(l, r);
 			}
 		}
-	}while(button(but));
+	}while(but <= 3 && button(but));
 	if(in){
 		h = s.max.y-s.min.y;
 		scrunmark(l, r);
 		p0 = 0;
-		if(but == 1)
+		if(but == 1 || but == 4){
+			but = 1;
 			p0 = (long)(my-s.min.y)/l->f.font->height+1;
-		else if(but == 2){
+		}else if(but == 2){
 			if(tot > 1024L*1024L)
 				p0 = ((tot>>10)*(y-s.min.y)/h)<<10;
 			else
 				p0 = tot*(y-s.min.y)/h;
-		}else if(but == 3){
+		}else if(but == 3 || but == 5){
+			but = 3;
 			p0 = l->origin+frcharofpt(&l->f, Pt(s.max.x, my));
 			if(p0 > tot)
 				p0 = tot;

Giacomo Tesio | 24 May 23:25 2016
Picon
Gravatar

create/create race

I'm pretty curious about the create(2)/create(5) race described in a comment in namec (see https://github.com/brho/plan9/blob/master/sys/src/9/port/chan.c#L1564-L1603)

Does anyone know or remember the reasoning behind this design?

What was wrong about using the create(5) semantics for the create(2) syscall?


Giacomo
trebol55555 | 24 May 21:57 2016
Picon

kremlin front9port

It's a great idea.

Maybe you can write the state of the programs ported? page is the p9p
version, factotum does not compile, mailfs does not have tls support...

Brian Vito | 22 May 20:32 2016

Looking for Printed Plan 9 Manuals

I am looking to purchase printed editions of the Plan 9 (and/or Unix) manuals,
principally the 2nd and 3rd edition manuals. Please contact me if you are willing
to part with copies for reasonable compensation. Thanks very much.

Iruatã Souza | 22 May 07:29 2016
Picon

Re: 9front sam in plan9port.

This is just a port of the 9front version of sam to p9p. As you can see, it hasn't been updated in a while. But I can do that if anybody wants it.

Em 21/05/2016 4:50 PM, <trebol55555 <at> yandex.ru> escreveu:
#define chording 0      /* code here for reference but it causes deadlocks */

I suppose the bug is still messing around.
I'll give it a try to the 9front version.

Thanks for the info!


trebol55555 | 21 May 17:35 2016
Picon

9front sam in plan9port.

Hello everyone,
any experience with this?

https://bitbucket.org/iru/sam9f-unix

trebol.

Casey Rodarmor | 21 May 09:26 2016
Gravatar

Namespace inheritance between processes

Hi 9 fans,

I'm trying to figure out how namespace inheritance between process groups works.

Let's say I have a process A which forks a child process B with the
RFNAMEG so it receives a copy of A's namespace.

If process A then makes a change to its namespace, will process B see
that change? Or does B receive a distinct copy that A then can't
change?

Thanks!

Best,
Casey


Gmane