mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Add exit-empty option to exit server if no sessions (defaults to on).
This commit is contained in:
		@@ -97,6 +97,12 @@ const struct options_table_entry options_table[] = {
 | 
				
			|||||||
	  .default_num = 500
 | 
						  .default_num = 500
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{ .name = "exit-empty",
 | 
				
			||||||
 | 
						  .type = OPTIONS_TABLE_FLAG,
 | 
				
			||||||
 | 
						  .scope = OPTIONS_TABLE_SERVER,
 | 
				
			||||||
 | 
						  .default_num = 1
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ .name = "exit-unattached",
 | 
						{ .name = "exit-unattached",
 | 
				
			||||||
	  .type = OPTIONS_TABLE_FLAG,
 | 
						  .type = OPTIONS_TABLE_FLAG,
 | 
				
			||||||
	  .scope = OPTIONS_TABLE_SERVER,
 | 
						  .scope = OPTIONS_TABLE_SERVER,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								server.c
									
									
									
									
									
								
							@@ -255,6 +255,9 @@ server_loop(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	server_client_loop();
 | 
						server_client_loop();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!options_get_number(global_options, "exit-empty") && !server_exit)
 | 
				
			||||||
 | 
							return (0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!options_get_number(global_options, "exit-unattached")) {
 | 
						if (!options_get_number(global_options, "exit-unattached")) {
 | 
				
			||||||
		if (!RB_EMPTY(&sessions))
 | 
							if (!RB_EMPTY(&sessions))
 | 
				
			||||||
			return (0);
 | 
								return (0);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							@@ -2503,6 +2503,11 @@ Set the time in milliseconds for which
 | 
				
			|||||||
waits after an escape is input to determine if it is part of a function or meta
 | 
					waits after an escape is input to determine if it is part of a function or meta
 | 
				
			||||||
key sequences.
 | 
					key sequences.
 | 
				
			||||||
The default is 500 milliseconds.
 | 
					The default is 500 milliseconds.
 | 
				
			||||||
 | 
					.It Xo Ic exit-empty
 | 
				
			||||||
 | 
					.Op Ic on | off
 | 
				
			||||||
 | 
					.Xc
 | 
				
			||||||
 | 
					If enabled (the default), the server will exit when there are no active
 | 
				
			||||||
 | 
					sessions.
 | 
				
			||||||
.It Xo Ic exit-unattached
 | 
					.It Xo Ic exit-unattached
 | 
				
			||||||
.Op Ic on | off
 | 
					.Op Ic on | off
 | 
				
			||||||
.Xc
 | 
					.Xc
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user