9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] rio exit menu
@ 2018-12-09 21:38 kvik
  2018-12-09 21:40 ` Steve Simon
  2018-12-11 21:24 ` Ethan Gardener
  0 siblings, 2 replies; 17+ messages in thread
From: kvik @ 2018-12-09 21:38 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 92 bytes --]

I find it useful to have an "Exit" menu entry, sometimes.
An opt-in option seems reasonable.

[-- Attachment #2: Type: text/plain, Size: 782 bytes --]

diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -120,21 +120,22 @@ void
 threadmain(int argc, char *argv[])
 {
 	char *initstr, *kbdin, *s;
+	int exitdoor;
 	char buf[256];
 	Image *i;
 	Rectangle r;
 
-	if(strstr(argv[0], ".out") == nil){
-		menu3str[Exit] = nil;
-		Hidden--;
-	}
 	initstr = nil;
 	kbdin = nil;
 	maxtab = 0;
+	exitdoor = 0;
 	ARGBEGIN{
 	case 'b':
 		reverse = ~0xFF;
 		break;
+	case 'e':
+		exitdoor = TRUE;
+		break;
 	case 'f':
 		fontname = EARGF(usage());
 		break;
@@ -155,6 +156,11 @@ threadmain(int argc, char *argv[])
 	default:
 		usage();
 	}ARGEND
+	
+	if(exitdoor == 0){
+		menu3str[Exit] = nil;
+		Hidden--;
+	}
 
 	if(getwd(buf, sizeof buf) == nil)
 		startdir = estrdup(".");

^ permalink raw reply	[flat|nested] 17+ messages in thread
* rio exit menu
@ 2018-12-09 20:26 qwx
  2018-12-09 20:38 ` [9front] " Julius Schmidt
  2018-12-13 10:44 ` Ethan Gardener
  0 siblings, 2 replies; 17+ messages in thread
From: qwx @ 2018-12-09 20:26 UTC (permalink / raw)
  To: 9front

Hello,

Currently, rio hides an 'Exit' entry in mouse menu 3 unless argv[0] contains
the string ".out".

The inlined patch below removes the check and exposes the entry.

While potentially dangerous, it is more convenient than manually killing a
given rio, and several people including me have been using this or similar
patches for a while.

What do you think?  Would anyone else like to see this merged?

Thanks,

qwx


diff -r 49bd5e4c9bde sys/src/cmd/rio/rio.c
--- a/sys/src/cmd/rio/rio.c	Wed Feb 07 18:53:08 2018 +0000
+++ b/sys/src/cmd/rio/rio.c	Thu Feb 15 23:00:00 2018 +0100
@@ -125,10 +125,6 @@
 	Image *i;
 	Rectangle r;
 
-	if(strstr(argv[0], ".out") == nil){
-		menu3str[Exit] = nil;
-		Hidden--;
-	}
 	initstr = nil;
 	kbdin = nil;
 	maxtab = 0;


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-12-13 10:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 21:38 [9front] rio exit menu kvik
2018-12-09 21:40 ` Steve Simon
2018-12-09 21:55   ` Kurt H Maier
2018-12-09 22:04     ` Steve Simon
2018-12-09 22:07       ` Kurt H Maier
2018-12-09 22:28   ` Stanley Lieber
2018-12-11 21:24 ` Ethan Gardener
2018-12-11 21:34   ` hiro
2018-12-11 21:54     ` Ethan Gardener
2018-12-11 23:11       ` Ethan Gardener
  -- strict thread matches above, loose matches on Subject: below --
2018-12-09 20:26 qwx
2018-12-09 20:38 ` [9front] " Julius Schmidt
2018-12-09 20:53   ` Steve Simon
2018-12-09 21:01   ` Stanley Lieber
2018-12-09 21:03     ` hiro
2018-12-09 21:29       ` qwx
2018-12-13  8:56       ` Ethan Gardener
2018-12-13 10:44 ` Ethan Gardener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).