mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	When a session is unattached, reset its activity timer to prevent it locking
instantly when reattached.
This commit is contained in:
		
							
								
								
									
										10
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								server.c
									
									
									
									
									
								
							@@ -1377,6 +1377,11 @@ server_lock_server(void)
 | 
			
		||||
		if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		if (s->flags & SESSION_UNATTACHED) {
 | 
			
		||||
			s->activity = time(NULL);
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		timeout = options_get_number(&s->options, "lock-after-time");
 | 
			
		||||
		if (timeout <= 0 || t <= s->activity + timeout)
 | 
			
		||||
			return;	/* not timed out */
 | 
			
		||||
@@ -1400,6 +1405,11 @@ server_lock_sessions(void)
 | 
			
		||||
		if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		if (s->flags & SESSION_UNATTACHED) {
 | 
			
		||||
			s->activity = time(NULL);
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		timeout = options_get_number(&s->options, "lock-after-time");
 | 
			
		||||
		if (timeout > 0 && t > s->activity + timeout) {
 | 
			
		||||
			server_lock_session(s);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user