96df3b
diff --git a/scp.c b/scp.c
96df3b
index d98fa67..25d347b 100644
96df3b
--- a/scp.c
96df3b
+++ b/scp.c
96df3b
@@ -638,7 +638,10 @@ toremote(char *targ, int argc, char **argv)
96df3b
 			addargs(&alist, "%s", ssh_program);
96df3b
 			addargs(&alist, "-x");
96df3b
 			addargs(&alist, "-oClearAllForwardings=yes");
96df3b
-			addargs(&alist, "-n");
96df3b
+			if (isatty(fileno(stdin)))
96df3b
+				addargs(&alist, "-t");
96df3b
+			else
96df3b
+				addargs(&alist, "-n");
96df3b
 			for (j = 0; j < remote_remote_args.num; j++) {
96df3b
 				addargs(&alist, "%s",
96df3b
 				    remote_remote_args.list[j]);