mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Fall back on normal session choice method if $TMUX exists but is invalid
rather than rejecting.
This commit is contained in:
		
							
								
								
									
										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. */
 | 
			
		||||
	if (data != NULL && data->pid != -1) {
 | 
			
		||||
		if (data->pid != getpid())
 | 
			
		||||
			return (NULL);
 | 
			
		||||
		if (data->idx > ARRAY_LENGTH(&sessions))
 | 
			
		||||
			return (NULL);
 | 
			
		||||
		if ((s = ARRAY_ITEM(&sessions, data->idx)) == NULL)
 | 
			
		||||
			return (NULL);
 | 
			
		||||
	if (data != NULL &&
 | 
			
		||||
	    data->pid == getpid() &&
 | 
			
		||||
	    data->idx <= ARRAY_LENGTH(&sessions) &&
 | 
			
		||||
	    (s = ARRAY_ITEM(&sessions, data->idx)) != NULL)
 | 
			
		||||
		return (s);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (cmd_choose_session(&sessions));
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user