1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:14:57 +00:00

Shell: Show termination signal if job did not exit cleanly

This commit is contained in:
AnotherTest 2020-12-06 20:52:43 +03:30 committed by Andreas Kling
parent 48a1f7e55c
commit 59b46a1f51
2 changed files with 6 additions and 1 deletions

View file

@ -853,7 +853,9 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
if (!job->exited())
return;
if (job->is_running_in_background() && job->should_announce_exit())
fprintf(stderr, "Shell: Job %" PRIu64 "(%s) exited\n", job->job_id(), job->cmd().characters());
warnln("Shell: Job {} ({}) exited\n", job->job_id(), job->cmd().characters());
else if (job->signaled() && job->should_announce_signal())
warnln("Shell: Job {} ({}) {}\n", job->job_id(), job->cmd().characters(), strsignal(job->termination_signal()));
last_return_code = job->exit_code();
job->disown();