Commit Diff


commit - 9c611279288ca016aeb214da4a23a8e2cce45027
commit + 81c2c5e775d83896f25981cf4c4e486c5cc91180
blob - 2d24f3312b03e4252610660e116aadf971e9c0c6
blob + 3dc1f2afa2bfbdb9bae906b5b169b88ab6c6d4c2
--- man/man1/acme.1
+++ man/man1/acme.1
@@ -533,6 +533,12 @@ and
 set to the window's id number
 (see
 .IR acme (4)).
+.PP
+The environment variable
+.B $acmeshell
+determines which shell is used to execute such commands; the
+.IR rc (1)
+shell is used by default. 
 .SS "Mouse button 3
 Pointing at text with button 3 instructs
 .I acme
blob - 740f3617608fc1a968c8a13556ffac7145a014e7
blob + 75745aff077a85862fa03a2a9b5a0e84d8ddcdaa
--- src/cmd/acme/acme.c
+++ src/cmd/acme/acme.c
@@ -133,6 +133,9 @@ threadmain(int argc, char *argv[])
 	cputype = getenv("cputype");
 	objtype = getenv("objtype");
 	home = getenv("HOME");
+	acmeshell = getenv("acmeshell");
+	if(acmeshell && *acmeshell == '\0')
+		acmeshell = nil;
 	p = getenv("tabstop");
 	if(p != nil){
 		maxtab = strtoul(p, nil, 0);
blob - 0539d1ac6864793daa17af28d4e4714fea88aa58
blob + 72860db3385d80b0afa27ad76345a25ea19ddb5f
--- src/cmd/acme/dat.h
+++ src/cmd/acme/dat.h
@@ -535,6 +535,7 @@ int			fsyspid;
 char			*cputype;
 char			*objtype;
 char			*home;
+char			*acmeshell;
 char			*fontnames[2];
 Image		*tagcols[NCOL];
 Image		*textcols[NCOL];
blob - 8262be4abf262bbfd3a2a9dcb3ed3f707ae8d2aa
blob + 81a2fcd961064b89416869868108b59795d772f1
--- src/cmd/acme/exec.c
+++ src/cmd/acme/exec.c
@@ -1358,6 +1358,7 @@ runproc(void *argvp)
 	char *rcarg[4];
 	void **argv;
 	CFsys *fs;
+	char *shell;
 
 	threadsetname("runproc");
 
@@ -1467,6 +1468,8 @@ runproc(void *argvp)
 
 	if(argaddr)
 		putenv("acmeaddr", argaddr);
+	if(acmeshell != nil)
+		goto Hard;
 	if(strlen(t) > sizeof buf-10)	/* may need to print into stack */
 		goto Hard;
 	inarg = FALSE;
@@ -1576,7 +1579,10 @@ Hard:
 		chdir(dir);	/* ignore error: probably app. window */
 		free(dir);
 	}
-	rcarg[0] = "rc";
+	shell = acmeshell;
+	if(shell == nil)
+		shell = "rc";
+	rcarg[0] = shell;
 	rcarg[1] = "-c";
 	rcarg[2] = t;
 	rcarg[3] = nil;
@@ -1590,7 +1596,7 @@ Hard:
 			sendul(cpid, ret);
 		threadexits(nil);
 	}
-	warning(nil, "exec rc: %r\n");
+	warning(nil, "exec %s: %r\n", shell);
 
    Fail:
 	/* threadexec hasn't happened, so send a zero */