From 228783cb58a32ebbdcd699fa23c6a061790f5ed1 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Fri, 12 Aug 2022 12:39:39 +0430 Subject: [PATCH] fbvnc: change process group if TERM_PGID is defined In fbpad, terminal switching signals (SIGUSR1 and SIGUSR2), if enabled, are send to TERM_PGID process group, which is usually an interactive shell. Fbvnc switches to that process group to get the switching signals. --- README | 7 ++----- fbvnc.c | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index 338b0a7..61fb8bc 100644 --- a/README +++ b/README @@ -26,8 +26,5 @@ when switching back to the tag, its old contents are shown. Also, it is possible to disable drawing when switching from the terminal in which fbvnc is run, and to enable it when switching back (instead of using ctrl-space manually each time). To do so, execute the shell in -fbpad using m-; (not the usual m-c), and then execute fbvnc as follows -(note that the exec is necessary, so that relevant signals are sent to -the fbvnc process): - - exec fbvnc host port +fbpad using m-; (not the usual m-c), to enable terminal switching +signals. diff --git a/fbvnc.c b/fbvnc.c index 771cbbe..b797f02 100644 --- a/fbvnc.c +++ b/fbvnc.c @@ -526,6 +526,9 @@ int main(int argc, char * argv[]) fprintf(stderr, "fbvnc: vnc init failed!\n"); return 1; } + if (getenv("TERM_PGID") != NULL && atoi(getenv("TERM_PGID")) == getppid()) + if (tcsetpgrp(0, getppid()) == 0) + setpgid(0, getppid()); term_setup(&ti); /* entering intellimouse for using mouse wheel */ -- 2.11.4.GIT