Conmux show display who is currently connected when you attach to a machine

From: Scott Zawalski <scottz@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1247 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/conmux/conmux b/conmux/conmux
index d3bc3b5..5a67500 100755
--- a/conmux/conmux
+++ b/conmux/conmux
@@ -979,6 +979,11 @@
 			$reply->{'title'} = $payload->title . ' [channel ' .
 				$payload->state() . ']';
 			$reply->{'state'} = $payload->state();
+			# Get connected clients and pass back as the motd
+			for my $cl (keys(%{$payload->cout})) {
+				reply->{'motd'} .= '(' . $payload->cout->{$cl}->id;
+				$reply->{'motd'} .= ") is already connected\n";
+			}
 
 			$data->payload($payload);
 			$args{'type'} = 'client' if (!$args{'type'});
diff --git a/conmux/console b/conmux/console
index 244fef1..9553948 100755
--- a/conmux/console
+++ b/conmux/console
@@ -124,6 +124,8 @@
 die "$P: $ARGV[0]: connect failed - $r{'status'}\n" if ($r{'status'} ne 'OK');
 
 print "Connected to $r{'title'} (~\$quit to exit)\n";
+#display message of the day passed by the server e.g. who is already connected
+print "$r{'motd'}";
 
 my $rin = $win = $ein = '';
 vec($rin, fileno(STDIN), 1) = 1;