shithub: riscv

Download patch

ref: 9360415d569515e7e3b212e5ca3416e766e32bec
parent: 19d6a98038953b27f539e1fd2187b7cfec9b108d
author: spew <devnull@localhost>
date: Fri May 18 17:36:33 EDT 2018

ssh:add -r for extra raw mode

--- a/sys/man/1/ssh
+++ b/sys/man/1/ssh
@@ -8,6 +8,8 @@
 ] [
 .B -R
 ] [
+.B -r
+] [
 .B -t
 .I thumbfile
 ] [
@@ -67,7 +69,7 @@
 Without
 .IR cmd ,
 a shell is started on the remote side.
-When the
+In that case and when the
 .B $TERM
 environment variable is set (such as when started under
 a terminal emulator like
@@ -75,6 +77,10 @@
 a pseudo terminal will be requested for the shell.
 This can be disabled with the
 .B -R
+option.
+A pseudo-terminal can be requested in all cases
+with the
+.B -r
 option.
 .PP
 The
--- a/sys/src/cmd/ssh.c
+++ b/sys/src/cmd/ssh.c
@@ -1160,6 +1160,9 @@
 	case 'R':
 		raw = 0;
 		break;
+	case 'r':
+		raw = 2; /* bloody */
+		break;
 	case 'u':
 		user = EARGF(usage());
 		break;
@@ -1193,8 +1196,9 @@
 	for(cmd = nil; *argv != nil; argv++){
 		if(cmd == nil){
 			cmd = strdup(*argv);
-			raw = 0;
-		}else {
+			if(raw == 1)
+				raw = 0;
+		}else{
 			s = smprint("%s %k", cmd, *argv);
 			free(cmd);
 			cmd = s;