From b6423991dce29bc0ba24c7a3ce602cca038fadc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 17 Jul 2021 12:47:21 +0200 Subject: Rename +h flag to +i (interactive), reverse meaning --- rtty.1 | 18 ++++++++++++------ rtty.c | 16 ++++++++-------- 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 #include -#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); -- cgit v1.2.3