mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-27 10:33:09 +01:00
Fall back on normal session choice method if $TMUX exists but is invalid
rather than rejecting.
This commit is contained in:
parent
65ff5b00bd
commit
6c42f1a89e
12
cmd.c
12
cmd.c
@ -340,15 +340,11 @@ cmd_current_session(struct cmd_ctx *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Use the session from the TMUX environment variable. */
|
/* Use the session from the TMUX environment variable. */
|
||||||
if (data != NULL && data->pid != -1) {
|
if (data != NULL &&
|
||||||
if (data->pid != getpid())
|
data->pid == getpid() &&
|
||||||
return (NULL);
|
data->idx <= ARRAY_LENGTH(&sessions) &&
|
||||||
if (data->idx > ARRAY_LENGTH(&sessions))
|
(s = ARRAY_ITEM(&sessions, data->idx)) != NULL)
|
||||||
return (NULL);
|
|
||||||
if ((s = ARRAY_ITEM(&sessions, data->idx)) == NULL)
|
|
||||||
return (NULL);
|
|
||||||
return (s);
|
return (s);
|
||||||
}
|
|
||||||
|
|
||||||
return (cmd_choose_session(&sessions));
|
return (cmd_choose_session(&sessions));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user