mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Sync OpenBSD patchset 217:
Show the bell/activity/current status and the window title in the choice list.
This commit is contained in:
parent
c32ca6a8e6
commit
d8a2ceea43
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-choose-window.c,v 1.13 2009-07-28 22:12:16 tcunha Exp $ */
|
/* $Id: cmd-choose-window.c,v 1.14 2009-08-09 16:41:17 tcunha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -52,6 +52,8 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
struct winlink *wl, *wm;
|
struct winlink *wl, *wm;
|
||||||
struct window *w;
|
struct window *w;
|
||||||
u_int idx, cur;
|
u_int idx, cur;
|
||||||
|
char flag, *title;
|
||||||
|
const char *left, *right;
|
||||||
|
|
||||||
if (ctx->curclient == NULL) {
|
if (ctx->curclient == NULL) {
|
||||||
ctx->error(ctx, "must be run interactively");
|
ctx->error(ctx, "must be run interactively");
|
||||||
@ -73,9 +75,30 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
cur = idx;
|
cur = idx;
|
||||||
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,
|
window_choose_add(wl->window->active,
|
||||||
wm->idx, "%3d: %s [%ux%u] (%u panes)",
|
wm->idx, "%3d: %s%c [%ux%u] (%u panes)%s%s%s",
|
||||||
wm->idx, w->name, w->sx, w->sy, window_count_panes(w));
|
wm->idx, w->name, flag, w->sx, w->sy, window_count_panes(w),
|
||||||
|
left, title, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
cdata = xmalloc(sizeof *cdata);
|
cdata = xmalloc(sizeof *cdata);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user