From 4fcc02ee9dde0f11f6a6db77b2ba6271421cea78 Mon Sep 17 00:00:00 2001 From: tim <tim> Date: Sun, 22 Nov 2015 18:28:01 +0000 Subject: [PATCH 1/3] If display-time is set to 0, show status messages until a key is pressed; OK nicm@ --- options-table.c | 2 +- status.c | 14 ++++++++------ tmux.1 | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/options-table.c b/options-table.c index a0e65ff4..dc4922ba 100644 --- a/options-table.c +++ b/options-table.c @@ -198,7 +198,7 @@ const struct options_table_entry options_table[] = { { .name = "display-time", .type = OPTIONS_TABLE_NUMBER, .scope = OPTIONS_TABLE_SESSION, - .minimum = 1, + .minimum = 0, .maximum = INT_MAX, .default_num = 750 }, diff --git a/status.c b/status.c index cbba2ead..d05376c0 100644 --- a/status.c +++ b/status.c @@ -574,13 +574,15 @@ status_message_set(struct client *c, const char *fmt, ...) } delay = options_get_number(c->session->options, "display-time"); - tv.tv_sec = delay / 1000; - tv.tv_usec = (delay % 1000) * 1000L; + if (delay > 0) { + tv.tv_sec = delay / 1000; + tv.tv_usec = (delay % 1000) * 1000L; - if (event_initialized(&c->message_timer)) - evtimer_del(&c->message_timer); - evtimer_set(&c->message_timer, status_message_callback, c); - evtimer_add(&c->message_timer, &tv); + if (event_initialized(&c->message_timer)) + evtimer_del(&c->message_timer); + evtimer_set(&c->message_timer, status_message_callback, c); + evtimer_add(&c->message_timer, &tv); + } c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE); c->flags |= CLIENT_STATUS; diff --git a/tmux.1 b/tmux.1 index a22bb3f3..3fd383d6 100644 --- a/tmux.1 +++ b/tmux.1 @@ -2557,6 +2557,7 @@ command appear. .It Ic display-time Ar time Set the amount of time for which status line messages and other on-screen indicators are displayed. +If set to 0, messages and indicators are displayed until a key is pressed. .Ar time is in milliseconds. .It Ic history-limit Ar lines From 01a2ddf3f8d22c58bd8423be69ab0e7843d71652 Mon Sep 17 00:00:00 2001 From: nicm <nicm> Date: Sun, 22 Nov 2015 19:41:19 +0000 Subject: [PATCH 2/3] Add getpw to pledge, makes tmux work in YP environments, discovered by matthieu, ok deraadt --- server.c | 4 ++-- tmux.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server.c b/server.c index 55a53a40..e17b9356 100644 --- a/server.c +++ b/server.c @@ -175,8 +175,8 @@ server_start(struct event_base *base, int lockfd, char *lockfile) if (debug_level > 3) tty_create_log(); - if (pledge("stdio rpath wpath cpath fattr unix recvfd proc exec tty " - "ps", NULL) != 0) + if (pledge("stdio rpath wpath cpath fattr unix getpw recvfd proc exec " + "tty ps", NULL) != 0) fatal("pledge failed"); RB_INIT(&windows); diff --git a/tmux.c b/tmux.c index 9baa8183..aa827178 100644 --- a/tmux.c +++ b/tmux.c @@ -255,8 +255,8 @@ main(int argc, char **argv) if (shell_cmd != NULL && argc != 0) usage(); - if (pledge("stdio rpath wpath cpath flock fattr unix sendfd recvfd " - "proc exec tty ps", NULL) != 0) + if (pledge("stdio rpath wpath cpath flock fattr unix getpw sendfd " + "recvfd proc exec tty ps", NULL) != 0) err(1, "pledge"); /* From 28e72ae34d43dda28ca0e6dc652eaa1179c351c7 Mon Sep 17 00:00:00 2001 From: nicm <nicm> Date: Sun, 22 Nov 2015 19:42:57 +0000 Subject: [PATCH 3/3] Don't leak extddata, memset after freeing it, not before. From Patrick Palka. --- grid.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/grid.c b/grid.c index 36cde074..579eb966 100644 --- a/grid.c +++ b/grid.c @@ -368,11 +368,8 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny) for (yy = py; yy < py + ny; yy++) { gl = &gd->linedata[yy]; free(gl->celldata); - memset(gl, 0, sizeof *gl); - free(gl->extddata); - gl->extddata = NULL; - gl->extdsize = 0; + memset(gl, 0, sizeof *gl); } }