mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Remove the lock-server option which is a bit redundant, it isn't that
different without it.
This commit is contained in:
		@@ -206,11 +206,6 @@ const struct options_table_entry session_options_table[] = {
 | 
			
		||||
	  .default_str = "lock -np"
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	{ .name = "lock-server",
 | 
			
		||||
	  .type = OPTIONS_TABLE_FLAG,
 | 
			
		||||
	  .default_num = 1
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	{ .name = "message-attr",
 | 
			
		||||
	  .type = OPTIONS_TABLE_ATTRIBUTES,
 | 
			
		||||
	  .default_num = 0,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								server.c
									
									
									
									
									
								
							@@ -64,7 +64,6 @@ void	server_child_signal(void);
 | 
			
		||||
void	server_child_exited(pid_t, int);
 | 
			
		||||
void	server_child_stopped(pid_t, int);
 | 
			
		||||
void	server_second_callback(int, short, void *);
 | 
			
		||||
void	server_lock_server(void);
 | 
			
		||||
void	server_lock_sessions(void);
 | 
			
		||||
 | 
			
		||||
/* Set marked pane. */
 | 
			
		||||
@@ -506,10 +505,7 @@ server_second_callback(unused int fd, unused short events, unused void *arg)
 | 
			
		||||
{
 | 
			
		||||
	struct timeval		 tv;
 | 
			
		||||
 | 
			
		||||
	if (options_get_number(&global_s_options, "lock-server"))
 | 
			
		||||
		server_lock_server();
 | 
			
		||||
	else
 | 
			
		||||
		server_lock_sessions();
 | 
			
		||||
	server_lock_sessions();
 | 
			
		||||
 | 
			
		||||
	evtimer_del(&server_ev_second);
 | 
			
		||||
	memset(&tv, 0, sizeof tv);
 | 
			
		||||
@@ -517,27 +513,6 @@ server_second_callback(unused int fd, unused short events, unused void *arg)
 | 
			
		||||
	evtimer_add(&server_ev_second, &tv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Lock the server if ALL sessions have hit the time limit. */
 | 
			
		||||
void
 | 
			
		||||
server_lock_server(void)
 | 
			
		||||
{
 | 
			
		||||
	struct session  *s;
 | 
			
		||||
	int		 timeout;
 | 
			
		||||
	time_t           t;
 | 
			
		||||
 | 
			
		||||
	t = time(NULL);
 | 
			
		||||
	RB_FOREACH(s, sessions, &sessions) {
 | 
			
		||||
		if (s->flags & SESSION_UNATTACHED)
 | 
			
		||||
			continue;
 | 
			
		||||
		timeout = options_get_number(&s->options, "lock-after-time");
 | 
			
		||||
		if (timeout <= 0 || t <= s->activity_time.tv_sec + timeout)
 | 
			
		||||
			return;	/* not timed out */
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	server_lock();
 | 
			
		||||
	recalculate_sizes();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Lock any sessions which have timed out. */
 | 
			
		||||
void
 | 
			
		||||
server_lock_sessions(void)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								tmux.1
									
									
									
									
									
								
							@@ -2561,9 +2561,7 @@ Lock the session (like the
 | 
			
		||||
.Ic lock-session
 | 
			
		||||
command) after
 | 
			
		||||
.Ar number
 | 
			
		||||
seconds of inactivity, or the entire server (all sessions) if the
 | 
			
		||||
.Ic lock-server
 | 
			
		||||
option is set.
 | 
			
		||||
seconds of inactivity.
 | 
			
		||||
The default is not to lock (set to 0).
 | 
			
		||||
.It Ic lock-command Ar shell-command
 | 
			
		||||
Command to run when locking each client.
 | 
			
		||||
@@ -2571,19 +2569,6 @@ The default is to run
 | 
			
		||||
.Xr lock 1
 | 
			
		||||
with
 | 
			
		||||
.Fl np .
 | 
			
		||||
.It Xo Ic lock-server
 | 
			
		||||
.Op Ic on | off
 | 
			
		||||
.Xc
 | 
			
		||||
If this option is
 | 
			
		||||
.Ic on
 | 
			
		||||
(the default),
 | 
			
		||||
instead of each session locking individually as each has been
 | 
			
		||||
idle for
 | 
			
		||||
.Ic lock-after-time ,
 | 
			
		||||
the entire server will lock after
 | 
			
		||||
.Em all
 | 
			
		||||
sessions would have locked.
 | 
			
		||||
This has no effect as a session option; it must be set as a global option.
 | 
			
		||||
.It Ic message-command-style Ar style
 | 
			
		||||
Set status line message command style, where
 | 
			
		||||
.Ar style
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user