diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-04 14:28:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-04 14:28:23 +0000 |
commit | 9e3bb986d59a930e409ee5a11b2fad72abe3dd68 (patch) | |
tree | 24e553c0a82be9fe89d0ef6287126d367fde9235 | |
parent | 93bf2a1d726c5f98a8460efcd199a8d202ecb3cc (diff) | |
download | rtmux-9e3bb986d59a930e409ee5a11b2fad72abe3dd68.tar.gz rtmux-9e3bb986d59a930e409ee5a11b2fad72abe3dd68.tar.bz2 rtmux-9e3bb986d59a930e409ee5a11b2fad72abe3dd68.zip |
Show the bell/activity/current status and the window title in the choice list.
-rw-r--r-- | cmd-choose-window.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/cmd-choose-window.c b/cmd-choose-window.c index 9386c5fa..efca9f80 100644 --- a/cmd-choose-window.c +++ b/cmd-choose-window.c @@ -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); |