mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Show signal name when process exits rather than number.
This commit is contained in:
parent
b6dfca9b4d
commit
a2e47b5279
@ -334,8 +334,8 @@ server_destroy_pane(struct window_pane *wp, int notify)
|
|||||||
tim);
|
tim);
|
||||||
} else if (WIFSIGNALED(wp->status)) {
|
} else if (WIFSIGNALED(wp->status)) {
|
||||||
screen_write_nputs(&ctx, -1, &gc,
|
screen_write_nputs(&ctx, -1, &gc,
|
||||||
"Pane is dead (signal %d, %s)",
|
"Pane is dead (signal %s, %s)",
|
||||||
WTERMSIG(wp->status),
|
sig2name(WTERMSIG(wp->status)),
|
||||||
tim);
|
tim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
tmux.c
12
tmux.c
@ -28,6 +28,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <signal.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -167,6 +168,17 @@ setblocking(int fd, int state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
sig2name(int signo)
|
||||||
|
{
|
||||||
|
static char s[11];
|
||||||
|
|
||||||
|
if (signo > 0 && signo < NSIG)
|
||||||
|
return (sys_signame[signo]);
|
||||||
|
xsnprintf(s, sizeof s, "%d", signo);
|
||||||
|
return (s);
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
find_cwd(void)
|
find_cwd(void)
|
||||||
{
|
{
|
||||||
|
1
tmux.h
1
tmux.h
@ -1725,6 +1725,7 @@ extern int ptm_fd;
|
|||||||
extern const char *shell_command;
|
extern const char *shell_command;
|
||||||
int checkshell(const char *);
|
int checkshell(const char *);
|
||||||
void setblocking(int, int);
|
void setblocking(int, int);
|
||||||
|
const char *sig2name(int);
|
||||||
const char *find_cwd(void);
|
const char *find_cwd(void);
|
||||||
const char *find_home(void);
|
const char *find_home(void);
|
||||||
const char *getversion(void);
|
const char *getversion(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user