mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Don't print exit messages when used as a login shell, requested by martynas@ a
while back.
This commit is contained in:
		
							
								
								
									
										50
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								client.c
									
									
									
									
									
								
							@@ -212,30 +212,36 @@ client_main(struct client_ctx *cctx)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
out:
 | 
			
		||||
 	if (sigterm) {
 | 
			
		||||
 		printf("[terminated]\n");
 | 
			
		||||
 		return (1);
 | 
			
		||||
 	}
 | 
			
		||||
	switch (cctx->exittype) {
 | 
			
		||||
	case CCTX_DIED:
 | 
			
		||||
		printf("[lost server]\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	case CCTX_SHUTDOWN:
 | 
			
		||||
		printf("[server exited]\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	case CCTX_EXIT:
 | 
			
		||||
		if (cctx->errstr != NULL) {
 | 
			
		||||
			printf("[error: %s]\n", cctx->errstr);
 | 
			
		||||
	/*
 | 
			
		||||
	 * Print exit status message, unless running as a login shell where it
 | 
			
		||||
	 * would either be pointless or irritating.
 | 
			
		||||
	 */
 | 
			
		||||
	if (!login_shell) {
 | 
			
		||||
		if (sigterm) {
 | 
			
		||||
			printf("[terminated]\n");
 | 
			
		||||
			return (1);
 | 
			
		||||
		}
 | 
			
		||||
		switch (cctx->exittype) {
 | 
			
		||||
		case CCTX_DIED:
 | 
			
		||||
			printf("[lost server]\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		case CCTX_SHUTDOWN:
 | 
			
		||||
			printf("[server exited]\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		case CCTX_EXIT:
 | 
			
		||||
			if (cctx->errstr != NULL) {
 | 
			
		||||
				printf("[error: %s]\n", cctx->errstr);
 | 
			
		||||
				return (1);
 | 
			
		||||
			}
 | 
			
		||||
			printf("[exited]\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		case CCTX_DETACH:
 | 
			
		||||
			printf("[detached]\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		default:
 | 
			
		||||
			printf("[unknown error]\n");
 | 
			
		||||
			return (1);
 | 
			
		||||
		}
 | 
			
		||||
		printf("[exited]\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	case CCTX_DETACH:
 | 
			
		||||
		printf("[detached]\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	default:
 | 
			
		||||
		printf("[unknown error]\n");
 | 
			
		||||
		return (1);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user