forked from github/abduco
Add explicit option for command pass through
This allows commands to be send interactively (i.e. when stdin refers
to a terminal). Also imply attach action if none is given, hence:
$ abduco -p session
cowsay hi
^D
can also be used to send input to a session.
This commit is contained in:
parent
c901f2bbb8
commit
fd34b98db7
12
abduco.1
12
abduco.1
|
|
@ -77,8 +77,9 @@ domain socket representing a session is deleted, sending
|
|||
.BR SIGUSR1
|
||||
to the server process will recreate it.
|
||||
|
||||
If standard input does not refer to a terminal, its content is passed
|
||||
through to the underlying session.
|
||||
If standard input does not refer to a terminal (or the
|
||||
.B -p
|
||||
option was given), its content is passed through to the underlying session.
|
||||
.SH OPTIONS
|
||||
If no command line arguments are given all currently active sessions are
|
||||
printed sorted by their respective creation date. Lines starting with an
|
||||
|
|
@ -120,6 +121,13 @@ Attach with the lowest priority, meaning this client will be the last to control
|
|||
.TP
|
||||
.BI \-q
|
||||
Be quiet, do not print informative messages.
|
||||
.TP
|
||||
.BI \-p
|
||||
Pass through content of standard input to the session. Implies the
|
||||
.B \-q
|
||||
and
|
||||
.B \-l
|
||||
options.
|
||||
.SH EXAMPLE
|
||||
Start a new session (assuming
|
||||
.BR dvtm(1)
|
||||
|
|
|
|||
9
abduco.c
9
abduco.c
|
|
@ -222,7 +222,7 @@ static void die(const char *s) {
|
|||
}
|
||||
|
||||
static void usage(void) {
|
||||
fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-r] [-q] [-l] [-f] [-e detachkey] name command\n");
|
||||
fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-p] [-r] [-q] [-l] [-f] [-e detachkey] name command\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -590,7 +590,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
passthrough = !isatty(STDIN_FILENO);
|
||||
|
||||
while ((opt = getopt(argc, argv, "aAclne:fqrv")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "aAclne:fpqrv")) != -1) {
|
||||
switch (opt) {
|
||||
case 'a':
|
||||
case 'A':
|
||||
|
|
@ -608,6 +608,9 @@ int main(int argc, char *argv[]) {
|
|||
case 'f':
|
||||
force = true;
|
||||
break;
|
||||
case 'p':
|
||||
passthrough = true;
|
||||
break;
|
||||
case 'q':
|
||||
quiet = true;
|
||||
break;
|
||||
|
|
@ -626,6 +629,8 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
if (passthrough) {
|
||||
if (!action)
|
||||
action = 'a';
|
||||
quiet = true;
|
||||
client.flags |= CLIENT_LOWPRIORITY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue