summaryrefslogtreecommitdiffstats
path: root/cmd-choose-window.c
authortcunha <tcunha>2009-08-09 16:41:17 (GMT)
committer tcunha <tcunha>2009-08-09 16:41:17 (GMT)
commit6c8a28dfa3cf4d286b2f60792878d1632feb2f47 (patch) (side-by-side diff)
tree3f290c8b31ca781e35b8c3c6676ca47bb0ba8e7d /cmd-choose-window.c
parent2926d8078fccd1ccc7dd97f5f5f1cbba73082583 (diff)
downloadtmux-old-6c8a28dfa3cf4d286b2f60792878d1632feb2f47.zip
tmux-old-6c8a28dfa3cf4d286b2f60792878d1632feb2f47.tar.gz
tmux-old-6c8a28dfa3cf4d286b2f60792878d1632feb2f47.tar.bz2
Sync OpenBSD patchset 217:
Show the bell/activity/current status and the window title in the choice list.
Diffstat (limited to 'cmd-choose-window.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-choose-window.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/cmd-choose-window.c b/cmd-choose-window.c
index 3f44775..f12546b 100644
--- a/cmd-choose-window.c
+++ b/cmd-choose-window.c
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id: cmd-choose-window.c,v 1.14 2009/08/09 16:41:17 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <[email protected]ers.sourceforge.net>
@@ -52,6 +52,8 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
struct winlink *wl, *wm;
struct window *w;
u_int idx, cur;
+ char flag, *title;
+ const char *left, *right;
if (ctx->curclient == NULL) {
ctx->error(ctx, "must be run interactively");
@@ -73,9 +75,30 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
cur = idx;
idx++;
+ flag = ' ';
+ if (session_alert_has(s, wm, WINDOW_ACTIVITY))
+ flag = '#';
+ else if (session_alert_has(s, wm, WINDOW_BELL))
+ flag = '!';
+ else if (session_alert_has(s, wm, WINDOW_CONTENT))
+ flag = '+';
+ else if (wm == s->curw)
+ flag = '*';
+ else if (wm == SLIST_FIRST(&s->lastw))
+ flag = '-';
+
+ title = w->active->screen->title;
+ if (wm == wl)
+ title = w->active->base.title;
+ left = " \"";
+ right = "\"";
+ if (*title == '\0')
+ left = right = "";
+
window_choose_add(wl->window->active,
- wm->idx, "%3d: %s [%ux%u] (%u panes)",
- wm->idx, w->name, w->sx, w->sy, window_count_panes(w));
+ wm->idx, "%3d: %s%c [%ux%u] (%u panes)%s%s%s",
+ wm->idx, w->name, flag, w->sx, w->sy, window_count_panes(w),
+ left, title, right);
}
cdata = xmalloc(sizeof *cdata);