From 307dfe94d423a0204b6aec7e4f9590e965cecdfb Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 15:42:01 -0400 Subject: [PATCH 01/11] Update client.c --- client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client.c b/client.c index 3d6d82b..55dfacd 100644 --- a/client.c +++ b/client.c @@ -47,6 +47,7 @@ static void client_setup_terminal(void) { cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; tcsetattr(STDIN_FILENO, TCSANOW, &cur_term); + printf("\x1b[?1002h\x1b[?1006h"); if (!alternate_buffer) { printf("\033[?1049h\033[H"); From 07edd619eed0dbd0894dcef22ed94c742b21bf47 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 15:59:42 -0400 Subject: [PATCH 02/11] Creating flag Support for Mouse CSI --- abduco.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/abduco.c b/abduco.c index b56e6f4..25c6050 100644 --- a/abduco.c +++ b/abduco.c @@ -223,7 +223,7 @@ static void die(const char *s) { } 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] [-e detachkey] [-m] name command\n"); exit(EXIT_FAILURE); } @@ -639,6 +639,8 @@ int main(int argc, char *argv[]) { case 'v': puts("abduco-"VERSION" © 2013-2018 Marc André Tanner"); exit(EXIT_SUCCESS); + case 'm': + mouse = true; default: usage(); } From 90282c41f65be9dcabf6805ad5697f37b78f746a Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:00:48 -0400 Subject: [PATCH 03/11] Mouse CSI if Flag selected --- client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 55dfacd..182fed4 100644 --- a/client.c +++ b/client.c @@ -47,7 +47,9 @@ static void client_setup_terminal(void) { cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; tcsetattr(STDIN_FILENO, TCSANOW, &cur_term); - printf("\x1b[?1002h\x1b[?1006h"); + if (mouse) { + printf("\x1b[?1002h\x1b[?1006h"); + } if (!alternate_buffer) { printf("\033[?1049h\033[H"); From b630101c3c79e16e45826be407071239d8e9a452 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:07:49 -0400 Subject: [PATCH 04/11] init variable --- abduco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abduco.c b/abduco.c index 25c6050..9a39061 100644 --- a/abduco.c +++ b/abduco.c @@ -121,7 +121,7 @@ typedef struct { static Server server = { .running = true, .exit_status = -1, .host = "@localhost" }; static Client client; static struct termios orig_term, cur_term; -static bool has_term, alternate_buffer, quiet, passthrough; +static bool has_term, alternate_buffer, quiet, passthrough, mouse; static struct sockaddr_un sockaddr = { .sun_family = AF_UNIX, From ffce2ff30b88bd28e45afe074c60fd882cd74e6c Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:16:25 -0400 Subject: [PATCH 05/11] Update abduco.c --- abduco.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/abduco.c b/abduco.c index 9a39061..5c25d5d 100644 --- a/abduco.c +++ b/abduco.c @@ -704,6 +704,10 @@ int main(int argc, char *argv[]) { if (!attach_session(server.session_name, true)) die("attach-session"); break; + case 'm': + if (!attach_session(server.session_name, true)) + die("attach-session"); + break; case 'A': if (session_alive(server.session_name)) { if (!attach_session(server.session_name, true)) From af31580a5fddbfd1895e2774272d3f5d9a63f1a4 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:25:04 -0400 Subject: [PATCH 06/11] Update abduco.c --- abduco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abduco.c b/abduco.c index 5c25d5d..4db1385 100644 --- a/abduco.c +++ b/abduco.c @@ -640,7 +640,7 @@ int main(int argc, char *argv[]) { puts("abduco-"VERSION" © 2013-2018 Marc André Tanner"); exit(EXIT_SUCCESS); case 'm': - mouse = true; + action = opt; default: usage(); } From 1ad5c4dc2bc0355e79d4cae8ba041d6a25caf2c4 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:33:54 -0400 Subject: [PATCH 07/11] Revert "Update abduco.c" This reverts commit af31580a5fddbfd1895e2774272d3f5d9a63f1a4. --- abduco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abduco.c b/abduco.c index 4db1385..5c25d5d 100644 --- a/abduco.c +++ b/abduco.c @@ -640,7 +640,7 @@ int main(int argc, char *argv[]) { puts("abduco-"VERSION" © 2013-2018 Marc André Tanner"); exit(EXIT_SUCCESS); case 'm': - action = opt; + mouse = true; default: usage(); } From 6ca8d0466489f7ad4d9b19d48fd43da41ce8352d Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:34:01 -0400 Subject: [PATCH 08/11] Revert "Update abduco.c" This reverts commit ffce2ff30b88bd28e45afe074c60fd882cd74e6c. --- abduco.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/abduco.c b/abduco.c index 5c25d5d..9a39061 100644 --- a/abduco.c +++ b/abduco.c @@ -704,10 +704,6 @@ int main(int argc, char *argv[]) { if (!attach_session(server.session_name, true)) die("attach-session"); break; - case 'm': - if (!attach_session(server.session_name, true)) - die("attach-session"); - break; case 'A': if (session_alive(server.session_name)) { if (!attach_session(server.session_name, true)) From 8a8e9b698259af0553b2fd3cb4fd8f1e5d3a7461 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:34:12 -0400 Subject: [PATCH 09/11] Revert "init variable" This reverts commit b630101c3c79e16e45826be407071239d8e9a452. --- abduco.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abduco.c b/abduco.c index 9a39061..25c6050 100644 --- a/abduco.c +++ b/abduco.c @@ -121,7 +121,7 @@ typedef struct { static Server server = { .running = true, .exit_status = -1, .host = "@localhost" }; static Client client; static struct termios orig_term, cur_term; -static bool has_term, alternate_buffer, quiet, passthrough, mouse; +static bool has_term, alternate_buffer, quiet, passthrough; static struct sockaddr_un sockaddr = { .sun_family = AF_UNIX, From 4d2f2a946b2058ed4b40f23cded6415316a6c279 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:34:37 -0400 Subject: [PATCH 10/11] Revert "Creating flag Support for Mouse CSI" This reverts commit 07edd619eed0dbd0894dcef22ed94c742b21bf47. --- abduco.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/abduco.c b/abduco.c index 25c6050..b56e6f4 100644 --- a/abduco.c +++ b/abduco.c @@ -223,7 +223,7 @@ static void die(const char *s) { } static void usage(void) { - fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-p] [-r] [-q] [-l] [-f] [-e detachkey] [-m] name command\n"); + fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-p] [-r] [-q] [-l] [-f] [-e detachkey] name command\n"); exit(EXIT_FAILURE); } @@ -639,8 +639,6 @@ int main(int argc, char *argv[]) { case 'v': puts("abduco-"VERSION" © 2013-2018 Marc André Tanner"); exit(EXIT_SUCCESS); - case 'm': - mouse = true; default: usage(); } From 21f19a0c8a50745fff96d0e182a8ea2571ffa857 Mon Sep 17 00:00:00 2001 From: Brandon Shockley Date: Mon, 2 Aug 2021 16:34:40 -0400 Subject: [PATCH 11/11] Revert "Mouse CSI if Flag selected" This reverts commit 90282c41f65be9dcabf6805ad5697f37b78f746a. --- client.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client.c b/client.c index 182fed4..55dfacd 100644 --- a/client.c +++ b/client.c @@ -47,9 +47,7 @@ static void client_setup_terminal(void) { cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; tcsetattr(STDIN_FILENO, TCSANOW, &cur_term); - if (mouse) { - printf("\x1b[?1002h\x1b[?1006h"); - } + printf("\x1b[?1002h\x1b[?1006h"); if (!alternate_buffer) { printf("\033[?1049h\033[H");