summaryrefslogtreecommitdiffstats
path: root/cmd-attach-session.c
diff options
context:
space:
mode:
authornicm <nicm>2015-06-04 23:27:51 +0000
committernicm <nicm>2015-06-04 23:27:51 +0000
commit6b2129696fbefe44d0adce1f2a11b4ae477cd07e (patch)
treed204c7289caf70e18ea66fe75a7e3a0e668fd844 /cmd-attach-session.c
parentdc0d34e13792ff14b5c02fac01af013dfe111c83 (diff)
Move the nested check from client to server and compare the client tty
name to all the pane pty names instead of comparing socket paths. This means that "new -d" will work without unsetting $TMUX.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r--cmd-attach-session.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index 46d568b4..f889019c 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -36,7 +36,7 @@ const struct cmd_entry cmd_attach_session_entry = {
"attach-session", "attach",
"c:drt:", 0, 0,
"[-dr] [-c working-directory] " CMD_TARGET_SESSION_USAGE,
- CMD_CANTNEST|CMD_STARTSERVER,
+ CMD_STARTSERVER,
cmd_attach_session_exec
};
@@ -81,6 +81,11 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
if (cmdq->client == NULL)
return (CMD_RETURN_NORMAL);
+ if (server_client_check_nested(cmdq->client)) {
+ cmdq_error(cmdq, "sessions should be nested with care, "
+ "unset $TMUX to force");
+ return (CMD_RETURN_ERROR);
+ }
if (wl != NULL) {
if (wp != NULL)