From b602c1fb9a9c12ce9876e21e28ddf7ad8b6556e6 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 28 May 2018 11:45:26 +0000 Subject: Document escaping inside conditionals, from "sadie-parayno" in GitHub issue 1359. --- tmux.1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tmux.1 b/tmux.1 index ee50a9fa..f9d7cb98 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3574,6 +3574,21 @@ if is enabled, or .Ql no if not. +Conditionals can be nested arbitrarily. +Inside a conditional, +.Ql \&, +and +.Ql } +must be escaped as +.Ql #, +and +.Ql #} , +unless they are part of a +.Ql #{...} +replacement. For example: +.Bd -literal -offset indent +#{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W . +.Ed .Pp Comparisons may be expressed by prefixing two comma-separated alternatives by -- cgit From c177a627d26d0e254390d27ad6348ea681ff0f7d Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 28 May 2018 11:50:47 +0000 Subject: When looking for panes, ignore dead ones (with -1 file descriptor). GitHub issue 1354. --- cmd-find.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd-find.c b/cmd-find.c index 5ecd4311..da4fe1e5 100644 --- a/cmd-find.c +++ b/cmd-find.c @@ -112,7 +112,7 @@ cmd_find_inside_pane(struct client *c) return (NULL); RB_FOREACH(wp, window_pane_tree, &all_window_panes) { - if (strcmp(wp->tty, c->ttyname) == 0) + if (wp->fd != -1 && strcmp(wp->tty, c->ttyname) == 0) break; } if (wp != NULL) @@ -223,7 +223,7 @@ fail: } /* - * Find the best winlink for a window (the current if it contains the pane, + * Find the best winlink for a window (the current if it contains the window, * otherwise the first). */ static int @@ -920,6 +920,10 @@ cmd_find_from_client(struct cmd_find_state *fs, struct client *c, int flags) cmd_find_log_state(__func__, fs); return (0); } + else { + log_debug("%s: session $%u does not have pane %%%u", + __func__, s->id, wp->id); + } } /* -- cgit