mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Change so that an empty session name always means the current sessions
even if given with, for example, -t '', and explicitly forbid empty session names and those containing a : when they are created.
This commit is contained in:
		@@ -68,9 +68,15 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
	u_int			 sx, sy, i;
 | 
			
		||||
 | 
			
		||||
	newname = args_get(args, 's');
 | 
			
		||||
	if (newname != NULL && session_find(newname) != NULL) {
 | 
			
		||||
		ctx->error(ctx, "duplicate session: %s", newname);
 | 
			
		||||
		return (-1);
 | 
			
		||||
	if (newname != NULL) {
 | 
			
		||||
		if (!session_check_name(newname)) {
 | 
			
		||||
			ctx->error(ctx, "bad session name: %s", newname);
 | 
			
		||||
			return (-1);
 | 
			
		||||
		}
 | 
			
		||||
		if (session_find(newname) != NULL) {
 | 
			
		||||
			ctx->error(ctx, "duplicate session: %s", newname);
 | 
			
		||||
			return (-1);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	target = args_get(args, 't');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user