# HG changeset patch # User Jun Wu # Date 2016-04-10 00:28:52 # Node ID b89e4457fa865ee6596157fe7b98639c1c39655e # Parent e442b628bfe6485d57ab4f10f941b89e96f04b05 chg: forward SIGWINCH to worker Before this patch, if the user uses chg and ncurses interface, resizing the terminal window will mess up its content. This patch fixes the issue by forwarding SIGWINCH to the worker process. diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c --- a/contrib/chg/chg.c +++ b/contrib/chg/chg.c @@ -397,6 +397,10 @@ static void setupsignalhandler(pid_t pid if (sigaction(SIGTERM, &sa, NULL) < 0) goto error; + /* notify the worker about window resize events */ + sa.sa_flags = SA_RESTART; + if (sigaction(SIGWINCH, &sa, NULL) < 0) + goto error; /* propagate job control requests to worker */ sa.sa_handler = forwardsignal; sa.sa_flags = SA_RESTART;