mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Add -N flag to never start server even if command would normally do so,
GitHub issue 2523.
This commit is contained in:
		
							
								
								
									
										2
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								client.c
									
									
									
									
									
								
							@@ -127,6 +127,8 @@ retry:
 | 
				
			|||||||
		log_debug("connect failed: %s", strerror(errno));
 | 
							log_debug("connect failed: %s", strerror(errno));
 | 
				
			||||||
		if (errno != ECONNREFUSED && errno != ENOENT)
 | 
							if (errno != ECONNREFUSED && errno != ENOENT)
 | 
				
			||||||
			goto failed;
 | 
								goto failed;
 | 
				
			||||||
 | 
							if (flags & CLIENT_NOSTARTSERVER)
 | 
				
			||||||
 | 
								goto failed;
 | 
				
			||||||
		if (~flags & CLIENT_STARTSERVER)
 | 
							if (~flags & CLIENT_STARTSERVER)
 | 
				
			||||||
			goto failed;
 | 
								goto failed;
 | 
				
			||||||
		close(fd);
 | 
							close(fd);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tmux.1
									
									
									
									
									
								
							@@ -191,6 +191,11 @@ directories are missing).
 | 
				
			|||||||
Behave as a login shell.
 | 
					Behave as a login shell.
 | 
				
			||||||
This flag currently has no effect and is for compatibility with other shells
 | 
					This flag currently has no effect and is for compatibility with other shells
 | 
				
			||||||
when using tmux as a login shell.
 | 
					when using tmux as a login shell.
 | 
				
			||||||
 | 
					.It Fl N
 | 
				
			||||||
 | 
					Do not start the server even if the command would normally do so (for example
 | 
				
			||||||
 | 
					.Ic new-session
 | 
				
			||||||
 | 
					or
 | 
				
			||||||
 | 
					.Ic start-server ) .
 | 
				
			||||||
.It Fl S Ar socket-path
 | 
					.It Fl S Ar socket-path
 | 
				
			||||||
Specify a full alternative path to the server socket.
 | 
					Specify a full alternative path to the server socket.
 | 
				
			||||||
If
 | 
					If
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tmux.c
									
									
									
									
									
								
							@@ -57,7 +57,7 @@ static __dead void
 | 
				
			|||||||
usage(void)
 | 
					usage(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	fprintf(stderr,
 | 
						fprintf(stderr,
 | 
				
			||||||
	    "usage: %s [-2CDluvV] [-c shell-command] [-f file] [-L socket-name]\n"
 | 
						    "usage: %s [-2CDlNuvV] [-c shell-command] [-f file] [-L socket-name]\n"
 | 
				
			||||||
	    "            [-S socket-path] [-T features] [command [flags]]\n",
 | 
						    "            [-S socket-path] [-T features] [command [flags]]\n",
 | 
				
			||||||
	    getprogname());
 | 
						    getprogname());
 | 
				
			||||||
	exit(1);
 | 
						exit(1);
 | 
				
			||||||
@@ -350,7 +350,7 @@ main(int argc, char **argv)
 | 
				
			|||||||
	if (**argv == '-')
 | 
						if (**argv == '-')
 | 
				
			||||||
		flags = CLIENT_LOGIN;
 | 
							flags = CLIENT_LOGIN;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while ((opt = getopt(argc, argv, "2c:CDdf:lL:qS:T:uUvV")) != -1) {
 | 
						while ((opt = getopt(argc, argv, "2c:CDdf:lL:NqS:T:uUvV")) != -1) {
 | 
				
			||||||
		switch (opt) {
 | 
							switch (opt) {
 | 
				
			||||||
		case '2':
 | 
							case '2':
 | 
				
			||||||
			tty_add_features(&feat, "256", ":,");
 | 
								tty_add_features(&feat, "256", ":,");
 | 
				
			||||||
@@ -380,6 +380,9 @@ main(int argc, char **argv)
 | 
				
			|||||||
			free(label);
 | 
								free(label);
 | 
				
			||||||
			label = xstrdup(optarg);
 | 
								label = xstrdup(optarg);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
 | 
							case 'N':
 | 
				
			||||||
 | 
								flags |= CLIENT_NOSTARTSERVER;
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
		case 'q':
 | 
							case 'q':
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 'S':
 | 
							case 'S':
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1635,7 +1635,7 @@ struct client {
 | 
				
			|||||||
#define CLIENT_DEAD 0x200
 | 
					#define CLIENT_DEAD 0x200
 | 
				
			||||||
#define CLIENT_REDRAWBORDERS 0x400
 | 
					#define CLIENT_REDRAWBORDERS 0x400
 | 
				
			||||||
#define CLIENT_READONLY 0x800
 | 
					#define CLIENT_READONLY 0x800
 | 
				
			||||||
/* 0x1000 unused */
 | 
					#define CLIENT_NOSTARTSERVER 0x1000
 | 
				
			||||||
#define CLIENT_CONTROL 0x2000
 | 
					#define CLIENT_CONTROL 0x2000
 | 
				
			||||||
#define CLIENT_CONTROLCONTROL 0x4000
 | 
					#define CLIENT_CONTROLCONTROL 0x4000
 | 
				
			||||||
#define CLIENT_FOCUSED 0x8000
 | 
					#define CLIENT_FOCUSED 0x8000
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user