mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Preserve exit status from run-shell and pass to the client.
This commit is contained in:
parent
9a55f65702
commit
5aeab5ab40
@ -160,6 +160,7 @@ cmd_run_shell_callback(struct job *job)
|
||||
{
|
||||
struct cmd_run_shell_data *cdata = job_get_data(job);
|
||||
struct bufferevent *event = job_get_event(job);
|
||||
struct cmdq_item *item = cdata->item;
|
||||
char *cmd = cdata->cmd, *msg = NULL, *line;
|
||||
size_t size;
|
||||
int retcode, status;
|
||||
@ -189,13 +190,17 @@ cmd_run_shell_callback(struct job *job)
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
retcode = WTERMSIG(status);
|
||||
xasprintf(&msg, "'%s' terminated by signal %d", cmd, retcode);
|
||||
retcode += 128;
|
||||
}
|
||||
if (msg != NULL)
|
||||
cmd_run_shell_print(job, msg);
|
||||
free(msg);
|
||||
|
||||
if (cdata->item != NULL)
|
||||
cmdq_continue(cdata->item);
|
||||
if (item != NULL) {
|
||||
if (item->client != NULL && item->client->session == NULL)
|
||||
item->client->retval = retcode;
|
||||
cmdq_continue(item);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user