aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-17 12:47:21 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-17 12:47:21 +0200
commitb6423991dce29bc0ba24c7a3ce602cca038fadc3 (patch)
tree946f1eb79ec69e90fc0e7f63b534e45b799ddd95
parenta8b5b7a407d19d1345e2b48bc9fa4912fb9c9393 (diff)
downloadrtty-b6423991dce29bc0ba24c7a3ce602cca038fadc3.tar.gz
Rename +h flag to +i (interactive), reverse meaning
-rw-r--r--rtty.118
-rw-r--r--rtty.c16
2 files changed, 20 insertions, 14 deletions
diff --git a/rtty.1 b/rtty.1
index 926e977..9c03e0f 100644
--- a/rtty.1
+++ b/rtty.1
@@ -6,7 +6,7 @@
.Nd limited but responsive remote shell
.Sh SYNOPSIS
.Nm
-.Op Sy +dpx
+.Op Sy +dipx
.Op Ar ...
.Sh DESCRIPTION
.Pp
@@ -31,13 +31,19 @@ are prefixed with a plus sign:
Disables all heuristics to detect password prompts
from the remote server and hide the user's input,
which are enabled by default.
-.It Sy +h
-Makes
+.It Sy +i
+Prevents
.Nm
-identify as a hard-copy terminal,
-preventing visual programs such as
+from identifying as a hard-copy terminal (tty43),
+allowing visual programs such as
.Xr vi 1
-from running.
+to run.
+Sets
+.Ev PAGER
+to
+.Xr ul 1
+instead of
+.Xr cat 1 .
.It Sy +p
Manually asks the user for a password
before connecting to the server.
diff --git a/rtty.c b/rtty.c
index a555e2c..f5df4ac 100644
--- a/rtty.c
+++ b/rtty.c
@@ -11,8 +11,8 @@
#include <termios.h>
#include <unistd.h>
-#define INIT "export EDITOR=ed PAGER=ul\n"
-#define HINIT "export TERM=tty43 EDITOR=ed PAGER=cat\n"
+#define INIT "export TERM=tty43 EDITOR=ed PAGER=cat\n"
+#define IINIT "export EDITOR=ed PAGER=ul\n"
#define MAXBUF 2048
#define MAXEARG 32
@@ -29,8 +29,8 @@ main(int argc, char *argv[])
*eargv[MAXEARG], in[30], **nargv, out[30], *p, pw[255], *q,
wd[MAXWD];
fd_set rfds0, rfds1;
- int child, dumb, escape, fdin, fdout, hardcopy, i, n, offset, s,
- sshpass;
+ int child, dumb, escape, fdin, fdout, i, interactive, n, offset,
+ s, sshpass;
struct timeval tv;
signal(SIGINT, noop);
@@ -45,10 +45,10 @@ main(int argc, char *argv[])
err(1, "mkfifo");
/* Process rtty-specific flags. */
- escape = dumb = hardcopy = sshpass = 0;
+ escape = dumb = interactive = sshpass = 0;
for(;argv[1][0] == '+';){
if(strchr(argv[1], 'd')) dumb = 1;
- if(strchr(argv[1], 'h')) hardcopy = 1;
+ if(strchr(argv[1], 'i')) interactive = 1;
if(strchr(argv[1], 'x')) escape = 1;
if(strchr(argv[1], 'p')) sshpass = 1;
@@ -115,8 +115,8 @@ main(int argc, char *argv[])
err(1, "open");
/* Print initialization command. */
- if(hardcopy)
- dprintf(fdin, HINIT);
+ if(interactive)
+ dprintf(fdin, IINIT);
else
dprintf(fdin, INIT);