forked from github/abduco
removed passthrough mode
This commit is contained in:
parent
14480decc7
commit
b70e814c8f
3
client.c
3
client.c
|
|
@ -101,8 +101,7 @@ static int client_mainloop(void) {
|
||||||
if (client_recv_packet(&pkt)) {
|
if (client_recv_packet(&pkt)) {
|
||||||
switch (pkt.type) {
|
switch (pkt.type) {
|
||||||
case MSG_CONTENT:
|
case MSG_CONTENT:
|
||||||
if (!passthrough)
|
write_all(STDOUT_FILENO, pkt.u.msg, pkt.len);
|
||||||
write_all(STDOUT_FILENO, pkt.u.msg, pkt.len);
|
|
||||||
break;
|
break;
|
||||||
case MSG_RESIZE:
|
case MSG_RESIZE:
|
||||||
client.need_resize = true;
|
client.need_resize = true;
|
||||||
|
|
|
||||||
22
splex.c
22
splex.c
|
|
@ -122,7 +122,7 @@ typedef struct {
|
||||||
static Server server = { .running = true, .exit_status = -1, .host = "@localhost" };
|
static Server server = { .running = true, .exit_status = -1, .host = "@localhost" };
|
||||||
static Client client;
|
static Client client;
|
||||||
static struct termios orig_term, cur_term;
|
static struct termios orig_term, cur_term;
|
||||||
static bool has_term, alternate_buffer, quiet, passthrough;
|
static bool has_term, alternate_buffer, quiet;
|
||||||
|
|
||||||
static struct sockaddr_un sockaddr = {
|
static struct sockaddr_un sockaddr = {
|
||||||
.sun_family = AF_UNIX,
|
.sun_family = AF_UNIX,
|
||||||
|
|
@ -603,7 +603,7 @@ int main(int argc, char *argv[]) {
|
||||||
server.name = basename(argv[0]);
|
server.name = basename(argv[0]);
|
||||||
gethostname(server.host+1, sizeof(server.host) - 1);
|
gethostname(server.host+1, sizeof(server.host) - 1);
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "aAclne:fpqrv")) != -1) {
|
while ((opt = getopt(argc, argv, "aAclne:fqrv")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'A':
|
case 'A':
|
||||||
|
|
@ -621,9 +621,6 @@ int main(int argc, char *argv[]) {
|
||||||
case 'f':
|
case 'f':
|
||||||
force = true;
|
force = true;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
|
||||||
passthrough = true;
|
|
||||||
break;
|
|
||||||
case 'q':
|
case 'q':
|
||||||
quiet = true;
|
quiet = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -634,7 +631,7 @@ int main(int argc, char *argv[]) {
|
||||||
client.flags |= CLIENT_LOWPRIORITY;
|
client.flags |= CLIENT_LOWPRIORITY;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
puts("abduco-"VERSION" © 2013-2018 Marc André Tanner");
|
puts("splex-0.1, based on abduco-"VERSION" by Marc André Tanner");
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
|
|
@ -651,22 +648,15 @@ int main(int argc, char *argv[]) {
|
||||||
else
|
else
|
||||||
cmd = default_cmd;
|
cmd = default_cmd;
|
||||||
|
|
||||||
if (server.session_name && !isatty(STDIN_FILENO))
|
if (!isatty(STDIN_FILENO))
|
||||||
passthrough = true;
|
die("STDIN is not a tty");
|
||||||
|
|
||||||
if (passthrough) {
|
|
||||||
if (!action)
|
|
||||||
action = 'a';
|
|
||||||
quiet = true;
|
|
||||||
client.flags |= CLIENT_LOWPRIORITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!action && !server.session_name)
|
if (!action && !server.session_name)
|
||||||
exit(list_session());
|
exit(list_session());
|
||||||
if (!action || !server.session_name)
|
if (!action || !server.session_name)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
if (!passthrough && tcgetattr(STDIN_FILENO, &orig_term) != -1) {
|
if (tcgetattr(STDIN_FILENO, &orig_term) != -1) {
|
||||||
server.term = orig_term;
|
server.term = orig_term;
|
||||||
has_term = true;
|
has_term = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue