st

simple terminal

git clone https://9o.is/git/st.git

commit aa833022e78388c5185de7219a8f615bf23d0c2e
parent 45b4610c7078d9f982d327f0382b728da30f9638
Author: Lauri Tirkkonen <lotheac@iki.fi>
Date:   Tue, 11 Dec 2018 11:43:03 +0200

output child WEXITSTATUS/WTERMSIG on abnormal termination

Diffstat:
Mst.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/st.c b/st.c @@ -731,8 +731,10 @@ sigchld(int a) if (pid != p) return; - if (!WIFEXITED(stat) || WEXITSTATUS(stat)) - die("child finished with error '%d'\n", stat); + if (WIFEXITED(stat) && WEXITSTATUS(stat)) + die("child exited with status %d\n", WEXITSTATUS(stat)); + else if (WIFSIGNALED(stat)) + die("child terminated due to signal %d\n", WTERMSIG(stat)); exit(0); }