Update of /cvsroot/tmux/tmux
In directory vz-cvs-2.sog:/tmp/cvs-serv28107

Modified Files:
        cmd-list-clients.c tmux.1 
Log Message:
|PatchSet 891
|Date: 2011/04/17 20:28:09
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Add -t to list-clients, based on a diff from Zac Sprackett.



Index: cmd-list-clients.c
===================================================================
RCS file: /cvsroot/tmux/tmux/cmd-list-clients.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cmd-list-clients.c  7 Jan 2011 14:45:34 -0000       1.21
+++ cmd-list-clients.c  18 Apr 2011 21:07:11 -0000      1.22
@@ -31,8 +31,8 @@
 
 const struct cmd_entry cmd_list_clients_entry = {
        "list-clients", "lsc",
-       "", 0, 0,
-       "",
+       "t:", 0, 0,
+       CMD_TARGET_SESSION_USAGE,
        0,
        NULL,
        NULL,
@@ -41,12 +41,21 @@
 
 /* ARGSUSED */
 int
-cmd_list_clients_exec(unused struct cmd *self, struct cmd_ctx *ctx)
+cmd_list_clients_exec(struct cmd *self, struct cmd_ctx *ctx)
 {
+       struct args     *args = self->args;
        struct client   *c;
+       struct session  *s;
        u_int            i;
        const char      *s_utf8;
 
+       if (args_has(args, 't')) {
+               s = cmd_find_session(ctx, args_get(args, 't'), 0);
+               if (s == NULL)
+                       return (-1);
+       } else
+               s = NULL;
+
        for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
                c = ARRAY_ITEM(&clients, i);
                if (c == NULL || c->session == NULL)
@@ -56,6 +65,9 @@
                        s_utf8 = " (utf8)";
                else
                        s_utf8 = "";
+
+               if (s != NULL && s != c->session)
+                       continue;
                ctx->print(ctx, "%s: %s [%ux%u %s]%s", c->tty.path,
                    c->session->name, c->tty.sx, c->tty.sy,
                    c->tty.termname, s_utf8);



------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
tmux-cvs mailing list
tmux-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to