mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 13:37:12 +00:00
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.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user