diff options
-rw-r--r-- | rtty.1 | 18 | ||||
-rw-r--r-- | rtty.c | 16 |
2 files changed, 20 insertions, 14 deletions
@@ -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. @@ -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); |