Revision: 2821
http://tmux.svn.sourceforge.net/tmux/?rev=2821&view=rev
Author: tcunha
Date: 2012-06-18 15:11:35 +0000 (Mon, 18 Jun 2012)
Log Message:
-----------
Sync OpenBSD patchset 1133:
Add -a flag for detach-client, from Thomas Adam.
Modified Paths:
--------------
trunk/cmd-detach-client.c
trunk/tmux.1
Modified: trunk/cmd-detach-client.c
===================================================================
--- trunk/cmd-detach-client.c 2012-06-18 15:10:40 UTC (rev 2820)
+++ trunk/cmd-detach-client.c 2012-06-18 15:11:35 UTC (rev 2821)
@@ -28,8 +28,8 @@
const struct cmd_entry cmd_detach_client_entry = {
"detach-client", "detach",
- "s:t:P", 0, 0,
- "[-P] [-s target-session] " CMD_TARGET_CLIENT_USAGE,
+ "as:t:P", 0, 0,
+ "[-P] [-a] [-s target-session] " CMD_TARGET_CLIENT_USAGE,
CMD_READONLY,
NULL,
NULL,
@@ -40,7 +40,7 @@
cmd_detach_client_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct args *args = self->args;
- struct client *c;
+ struct client *c, *c2;
struct session *s;
enum msgtype msgtype;
u_int i;
@@ -65,7 +65,15 @@
if (c == NULL)
return (-1);
- server_write_client(c, msgtype, NULL, 0);
+ if (args_has(args, 'a')) {
+ for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+ c2 = ARRAY_ITEM(&clients, i);
+ if (c2 == NULL || c == c2)
+ continue;
+ server_write_client(c2, msgtype, NULL, 0);
+ }
+ } else
+ server_write_client(c, msgtype, NULL, 0);
}
return (0);
Modified: trunk/tmux.1
===================================================================
--- trunk/tmux.1 2012-06-18 15:10:40 UTC (rev 2820)
+++ trunk/tmux.1 2012-06-18 15:11:35 UTC (rev 2821)
@@ -589,6 +589,7 @@
session.
.It Xo Ic detach-client
.Op Fl P
+.Op Fl a
.Op Fl s Ar target-session
.Op Fl t Ar target-client
.Xc
@@ -597,6 +598,10 @@
.Fl t ,
or all clients currently attached to the session specified by
.Fl s .
+The
+.Fl a
+option kills all but the client given with
+.Fl t .
If
.Fl P
is given, send SIGHUP to the parent process of the client, typically causing it
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs