PATCH: remove newline from ctime_r()

11 views
Skip to first unread message

Thomas Adam

unread,
Jul 29, 2020, 6:29:05 PM7/29/20
to tmux-...@googlegroups.com
Hi,

I'm not sure what may have changed recently, but I've noticed the newline
being part of the status messages coming from panes which have remain-on-exit
set. For example:

Pane is dead (status 255, Wed Jul 29 23:27:17 2020
)

I'm pretty sure we never used to keep the newline from ctime_r() and yet it's
s part of the standard. It's one of those visually annoying bugs.

Anyway, this works:

diff --git a/server-fn.c b/server-fn.c
index d5e7cbd7..adc14a0f 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -342,6 +342,7 @@ server_destroy_pane(struct window_pane *wp, int notify)

time(&t);
ctime_r(&t, tim);
+ tim[strlen(tim) - 1] = '\0';

if (WIFEXITED(wp->status)) {
screen_write_nputs(&ctx, -1, &gc,

-- Thomas Adam

Nicholas Marriott

unread,
Jul 30, 2020, 3:33:10 AM7/30/20
to Thomas Adam, tmux-users
Previously screen_write_nputs would have ignored it, fixed now, thanks!

--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/20200729222900.lrjliemizyddyvpv%40debian.
Reply all
Reply to author
Forward
0 new messages