=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-attach-session.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/tmux/cmd-attach-session.c 2009/12/03 22:50:09 1.11 +++ src/usr.bin/tmux/cmd-attach-session.c 2010/02/06 22:55:31 1.12 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.11 2009/12/03 22:50:09 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.12 2010/02/06 22:55:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -28,8 +28,8 @@ const struct cmd_entry cmd_attach_session_entry = { "attach-session", "attach", - "[-d] " CMD_TARGET_SESSION_USAGE, - CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d", + "[-dr] " CMD_TARGET_SESSION_USAGE, + CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "dr", cmd_target_init, cmd_target_parse, cmd_attach_session_exec, @@ -88,6 +88,9 @@ xfree(cause); return (-1); } + + if (cmd_check_flag(data->chflags, 'r')) + ctx->cmdclient->flags |= CLIENT_READONLY; if (cmd_check_flag(data->chflags, 'd')) server_write_session(s, MSG_DETACH, NULL, 0);