=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/window.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- src/usr.bin/tmux/window.c 2010/12/06 22:51:02 1.60 +++ src/usr.bin/tmux/window.c 2010/12/30 21:35:17 1.61 @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.60 2010/12/06 22:51:02 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.61 2010/12/30 21:35:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -461,6 +461,32 @@ TAILQ_REMOVE(&w->panes, wp, entry); window_pane_destroy(wp); } +} + +/* Return list of printable window flag symbols. No flags is just a space. */ +char * +window_printable_flags(struct session *s, struct winlink *wl) +{ + char flags[BUFSIZ]; + int pos; + + pos = 0; + if (wl->flags & WINLINK_ACTIVITY) + flags[pos++] = '#'; + if (wl->flags & WINLINK_BELL) + flags[pos++] = '!'; + if (wl->flags & WINLINK_CONTENT) + flags[pos++] = '+'; + if (wl->flags & WINLINK_SILENCE) + flags[pos++] = '~'; + if (wl == s->curw) + flags[pos++] = '*'; + if (wl == TAILQ_FIRST(&s->lastw)) + flags[pos++] = '-'; + if (pos == 0) + flags[pos++] = ' '; + flags[pos] = '\0'; + return (xstrdup(flags)); } struct window_pane *