Revision: 2582 http://tmux.svn.sourceforge.net/tmux/?rev=2582&view=rev Author: tcunha Date: 2011-08-21 12:38:55 +0000 (Sun, 21 Aug 2011)
Log Message: ----------- Sync OpenBSD patchset 946: Add a -r flag to switch-client to toggle the client read-only flag. From Johan Commelin. Modified Paths: -------------- trunk/cmd-choose-client.c trunk/cmd-list-clients.c trunk/cmd-switch-client.c trunk/tmux.1 Modified: trunk/cmd-choose-client.c =================================================================== --- trunk/cmd-choose-client.c 2011-08-21 12:37:26 UTC (rev 2581) +++ trunk/cmd-choose-client.c 2011-08-21 12:38:55 UTC (rev 2582) @@ -76,9 +76,11 @@ idx++; window_choose_add(wl->window->active, i, - "%s: %s [%ux%u %s]%s", c->tty.path, + "%s: %s [%ux%u %s]%s%s", c->tty.path, c->session->name, c->tty.sx, c->tty.sy, - c->tty.termname, c->tty.flags & TTY_UTF8 ? " (utf8)" : ""); + c->tty.termname, + c->tty.flags & TTY_UTF8 ? " (utf8)" : "", + c->flags & CLIENT_READONLY ? " (ro)" : ""); } cdata = xmalloc(sizeof *cdata); Modified: trunk/cmd-list-clients.c =================================================================== --- trunk/cmd-list-clients.c 2011-08-21 12:37:26 UTC (rev 2581) +++ trunk/cmd-list-clients.c 2011-08-21 12:38:55 UTC (rev 2582) @@ -33,7 +33,7 @@ "list-clients", "lsc", "t:", 0, 0, CMD_TARGET_SESSION_USAGE, - 0, + CMD_READONLY, NULL, NULL, cmd_list_clients_exec @@ -68,9 +68,10 @@ if (s != NULL && s != c->session) continue; - ctx->print(ctx, "%s: %s [%ux%u %s]%s", c->tty.path, + ctx->print(ctx, "%s: %s [%ux%u %s]%s%s", c->tty.path, c->session->name, c->tty.sx, c->tty.sy, - c->tty.termname, s_utf8); + c->tty.termname, s_utf8, + c->flags & CLIENT_READONLY ? " (ro)" : ""); } return (0); Modified: trunk/cmd-switch-client.c =================================================================== --- trunk/cmd-switch-client.c 2011-08-21 12:37:26 UTC (rev 2581) +++ trunk/cmd-switch-client.c 2011-08-21 12:38:55 UTC (rev 2582) @@ -32,9 +32,9 @@ const struct cmd_entry cmd_switch_client_entry = { "switch-client", "switchc", - "lc:npt:", 0, 0, - "[-lnp] [-c target-client] [-t target-session]", - 0, + "lc:npt:r", 0, 0, + "[-lnpr] [-c target-client] [-t target-session]", + CMD_READONLY, cmd_switch_client_key_binding, NULL, cmd_switch_client_exec @@ -67,6 +67,16 @@ if ((c = cmd_find_client(ctx, args_get(args, 'c'))) == NULL) return (-1); + if (args_has(args, 'r')) { + if (c->flags & CLIENT_READONLY) { + c->flags &= ~CLIENT_READONLY; + ctx->info(ctx, "made client writable"); + } else { + c->flags |= CLIENT_READONLY; + ctx->info(ctx, "made client read-only"); + } + } + s = NULL; if (args_has(args, 'n')) { if ((s = session_next_session(c->session)) == NULL) { Modified: trunk/tmux.1 =================================================================== --- trunk/tmux.1 2011-08-21 12:37:26 UTC (rev 2581) +++ trunk/tmux.1 2011-08-21 12:38:55 UTC (rev 2582) @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 30 2011 $ +.Dd $Mdocdate: August 16 2011 $ .Dt TMUX 1 .Os .Sh NAME @@ -562,7 +562,9 @@ .Fl r signifies the client is read-only (only keys bound to the .Ic detach-client -command have any effect) +or +.Ic switch-client +commands have any effect) .Pp If no server is started, .Ic attach-session @@ -718,7 +720,7 @@ .Dv SIGTSTP (tty stop). .It Xo Ic switch-client -.Op Fl lnp +.Op Fl lnpr .Op Fl c Ar target-client .Op Fl t Ar target-session .Xc @@ -734,6 +736,10 @@ .Fl p is used, the client is moved to the last, next or previous session respectively. +.Fl r +toggles whether a client is read-only (see the +.Ic attach-session +command). .El .Sh WINDOWS AND PANES A This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ tmux-cvs mailing list tmux-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-cvs