mirror of
https://github.com/tmux/tmux.git
synced 2025-10-26 12:27:15 +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:
@@ -46,6 +46,27 @@ void server_client_msg_command(struct client *, struct imsg *);
|
||||
void server_client_msg_identify(struct client *, struct imsg *);
|
||||
void server_client_msg_shell(struct client *);
|
||||
|
||||
/* Check if this client is inside this server. */
|
||||
int
|
||||
server_client_check_nested(struct client *c)
|
||||
{
|
||||
struct environ_entry *envent;
|
||||
struct window_pane *wp;
|
||||
|
||||
if (c->tty.path == NULL)
|
||||
return (0);
|
||||
|
||||
envent = environ_find(&c->environ, "TMUX");
|
||||
if (envent == NULL || *envent->value == '\0')
|
||||
return (0);
|
||||
|
||||
RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
|
||||
if (strcmp(wp->tty, c->tty.path) == 0)
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Set client key table. */
|
||||
void
|
||||
server_client_key_table(struct client *c, const char *name)
|
||||
|
||||
Reference in New Issue
Block a user