mirror of https://github.com/martanne/abduco
Merge 135583c073 into 8c32909a15
This commit is contained in:
commit
5c5f872690
3
abduco.1
3
abduco.1
|
|
@ -115,6 +115,9 @@ options.
|
||||||
Be quiet, do not print informative messages.
|
Be quiet, do not print informative messages.
|
||||||
.It Fl r
|
.It Fl r
|
||||||
Read-only session, user input is ignored.
|
Read-only session, user input is ignored.
|
||||||
|
.IT F1 s
|
||||||
|
Silently Attach/Detach without switching to/from alternate buffer. Useful for automatically reconnecting
|
||||||
|
persistent SSH connections that don't want to alter terminal state when reconnecting.
|
||||||
.It Fl v
|
.It Fl v
|
||||||
Print version information and exit.
|
Print version information and exit.
|
||||||
.El
|
.El
|
||||||
|
|
|
||||||
6
abduco.c
6
abduco.c
|
|
@ -98,6 +98,7 @@ struct Client {
|
||||||
enum {
|
enum {
|
||||||
CLIENT_READONLY = 1 << 0,
|
CLIENT_READONLY = 1 << 0,
|
||||||
CLIENT_LOWPRIORITY = 1 << 1,
|
CLIENT_LOWPRIORITY = 1 << 1,
|
||||||
|
CLIENT_NOALTBUF = 1 << 1,
|
||||||
} flags;
|
} flags;
|
||||||
Client *next;
|
Client *next;
|
||||||
};
|
};
|
||||||
|
|
@ -223,7 +224,7 @@ static void die(const char *s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage(void) {
|
static void usage(void) {
|
||||||
fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-p] [-r] [-q] [-l] [-f] [-e detachkey] name command\n");
|
fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-p] [-r] [-q] [-l] [-f] [-s] [-e detachkey] name command\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -633,6 +634,9 @@ int main(int argc, char *argv[]) {
|
||||||
case 'r':
|
case 'r':
|
||||||
client.flags |= CLIENT_READONLY;
|
client.flags |= CLIENT_READONLY;
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
client.flags |= CLIENT_NOALTBUF;
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
client.flags |= CLIENT_LOWPRIORITY;
|
client.flags |= CLIENT_LOWPRIORITY;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
4
client.c
4
client.c
|
|
@ -25,7 +25,7 @@ static void client_restore_terminal(void) {
|
||||||
if (!has_term)
|
if (!has_term)
|
||||||
return;
|
return;
|
||||||
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_term);
|
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_term);
|
||||||
if (alternate_buffer) {
|
if (!(client.flags & CLIENT_NOALTBUF) && alternate_buffer) {
|
||||||
printf("\033[?25h\033[?1049l");
|
printf("\033[?25h\033[?1049l");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
alternate_buffer = false;
|
alternate_buffer = false;
|
||||||
|
|
@ -48,7 +48,7 @@ static void client_setup_terminal(void) {
|
||||||
cur_term.c_cc[VTIME] = 0;
|
cur_term.c_cc[VTIME] = 0;
|
||||||
tcsetattr(STDIN_FILENO, TCSANOW, &cur_term);
|
tcsetattr(STDIN_FILENO, TCSANOW, &cur_term);
|
||||||
|
|
||||||
if (!alternate_buffer) {
|
if (!(client.flags & CLIENT_NOALTBUF) && !alternate_buffer) {
|
||||||
printf("\033[?1049h\033[H");
|
printf("\033[?1049h\033[H");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
alternate_buffer = true;
|
alternate_buffer = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue