From a6d3594d395a61cfab97a69ebcf85bff71875f2f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 2 Oct 2007 17:45:05 +0000 Subject: [PATCH] Redraw client status lines on rename. --- CHANGES | 3 ++- TODO | 1 + server-fn.c | 4 +--- server-msg.c | 11 ++++++++++- tmux.h | 3 ++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index e5eaf91b..94b021f0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 02 October 2007 +* (nicm) Redraw client status lines on rename. * (nicm) Error on ambiguous command. 01 October 2007 @@ -89,5 +90,5 @@ (including mutt, emacs). No status bar yet and no key remapping or other customisation. -$Id: CHANGES,v 1.21 2007-10-02 17:36:16 nicm Exp $ +$Id: CHANGES,v 1.22 2007-10-02 17:45:05 nicm Exp $ diff --git a/TODO b/TODO index cca7a5cc..972504bd 100644 --- a/TODO +++ b/TODO @@ -42,6 +42,7 @@ unlink window (error if window only linked to one session) close window kill session + set status on/off - fix resize (width problems with multiple clients?) - handle tmux in tmux (check $TMUX and abort) - check for some reqd terminfo caps on startup diff --git a/server-fn.c b/server-fn.c index 58799c77..83faba07 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.10 2007-10-01 14:53:29 nicm Exp $ */ +/* $Id: server-fn.c,v 1.11 2007-10-02 17:45:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -23,8 +23,6 @@ #include "tmux.h" -void server_draw_status(struct client *); - /* Find session from sessid. */ struct session * server_find_sessid(struct sessid *sid, char **cause) diff --git a/server-msg.c b/server-msg.c index 0ea9299a..1b9cd3fb 100644 --- a/server-msg.c +++ b/server-msg.c @@ -1,4 +1,4 @@ -/* $Id: server-msg.c,v 1.13 2007-10-01 14:53:29 nicm Exp $ */ +/* $Id: server-msg.c,v 1.14 2007-10-02 17:45:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -401,6 +401,7 @@ server_msg_fn_rename(struct hdr *hdr, struct client *c) char *cause; struct window *w; struct session *s; + u_int i; if (hdr->size != sizeof data) fatalx("bad MSG_RENAME size"); @@ -429,6 +430,14 @@ server_msg_fn_rename(struct hdr *hdr, struct client *c) strlcpy(w->name, data.newname, sizeof w->name); server_write_client(c, MSG_DONE, NULL, 0); + for (i = 0; i < ARRAY_LENGTH(&clients); i++) { + c = ARRAY_ITEM(&clients, i); + if (c != NULL && c->session != NULL) { + if (session_has(c->session, w)) + server_draw_status(c); + } + } + return (0); } diff --git a/tmux.h b/tmux.h index b205017c..d2011b9c 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.32 2007-10-01 17:37:41 nicm Exp $ */ +/* $Id: tmux.h,v 1.33 2007-10-02 17:45:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -551,6 +551,7 @@ void server_write_clients( struct window *, enum hdrtype, const void *, size_t); void server_window_changed(struct client *); void server_draw_client(struct client *, u_int, u_int); +void server_draw_status(struct client *); /* status.c */ void status_write(struct client *c);