From dceb6a15d04a2b2e050ab41816d0df3fe224b416 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 16 May 2020 16:07:55 +0000 Subject: Add a -D flag to ask tmux not to daemonize, useful both for running a debugger (lldb does not have follow-fork-mode) and for running with a managed supervisor init system. GitHub issue 2190. --- tty.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tty.c') diff --git a/tty.c b/tty.c index c8efeac7..a1e2f2c6 100644 --- a/tty.c +++ b/tty.c @@ -154,16 +154,21 @@ tty_read_callback(__unused int fd, __unused short events, void *data) { struct tty *tty = data; struct client *c = tty->client; + const char *name = c->name; size_t size = EVBUFFER_LENGTH(tty->in); int nread; nread = evbuffer_read(tty->in, tty->fd, -1); if (nread == 0 || nread == -1) { + if (nread == 0) + log_debug("%s: read closed", name); + else + log_debug("%s: read error: %s", name, strerror(errno)); event_del(&tty->event_in); server_client_lost(tty->client); return; } - log_debug("%s: read %d bytes (already %zu)", c->name, nread, size); + log_debug("%s: read %d bytes (already %zu)", name, nread, size); while (tty_keys_next(tty)) ; -- cgit