From bc236109fd8b858f1bfd7e4b9c5d5e493bdd1563 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Sun, 11 Oct 2009 23:55:26 +0000 Subject: Sync OpenBSD patchset 374: Rather than running status-left, status-right and window title #() with popen immediately every redraw, queue them up and run them in the background, starting each once every status-interval. The actual status line uses the output from the last run. This brings several advantages: - tmux itself may be called from inside #() without causing the server to hang; - likewise, sleep or similar doesn't cause the server to block; - commands aren't run excessively often when redrawing; - commands shared by status-left and status-right, or used multiple times, will only be run once. run-shell and if-shell still use system()/popen() but will be changed over to use this too later. --- cmd-set-option.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cmd-set-option.c') diff --git a/cmd-set-option.c b/cmd-set-option.c index f1ff4c4b..901523b1 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $Id: cmd-set-option.c,v 1.83 2009-10-11 23:46:02 tcunha Exp $ */ +/* $Id: cmd-set-option.c,v 1.84 2009-10-11 23:55:26 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -186,8 +186,11 @@ cmd_set_option_exec(struct cmd *self, struct cmd_ctx *ctx) recalculate_sizes(); for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (c != NULL && c->session != NULL) + if (c != NULL && c->session != NULL) { + job_tree_free(&c->status_jobs); + job_tree_init(&c->status_jobs); server_redraw_client(c); + } } return (0); -- cgit