Shell: Print if the process exited because of a signal

This commit is contained in:
Bananymous 2023-08-01 14:24:36 +03:00
parent 217dbca7b7
commit 9fe878bbec
1 changed files with 4 additions and 1 deletions

View File

@ -395,7 +395,10 @@ int execute_command(BAN::Vector<BAN::String>& args)
if (tcsetpgrp(0, getpid()) == -1)
ERROR_RETURN("tcsetpgrp", 1);
return status;
if (WIFSIGNALED(status))
fprintf(stderr, "Terminated by signal %d\n", WTERMSIG(status));
return WEXITSTATUS(status);
}
return 0;