mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Make server exit when last session dies. Also fix window check for status activity redraw.
This commit is contained in:
		
							
								
								
									
										18
									
								
								session.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								session.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: session.c,v 1.35 2008-06-06 17:20:29 nicm Exp $ */
 | 
			
		||||
/* $Id: session.c,v 1.36 2008-06-06 17:55:27 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -55,7 +55,8 @@ session_alert_add(struct session *s, struct window *w, int type)
 | 
			
		||||
		if (wl == s->curw)
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		if (wl->window == w && !session_alert_has(s, wl, type)) {
 | 
			
		||||
		if (wl->window == w &&
 | 
			
		||||
		    !session_alert_has(s, wl, type)) {
 | 
			
		||||
			sa = xmalloc(sizeof *sa);
 | 
			
		||||
			sa->wl = wl;
 | 
			
		||||
			sa->type = type;
 | 
			
		||||
@@ -77,6 +78,19 @@ session_alert_has(struct session *s, struct winlink *wl, int type)
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
session_alert_has_window(struct session *s, struct window *w, int type)
 | 
			
		||||
{
 | 
			
		||||
	struct session_alert	*sa;
 | 
			
		||||
 | 
			
		||||
	TAILQ_FOREACH(sa, &s->alerts, entry) {
 | 
			
		||||
		if (sa->wl->window == w && sa->type == type)
 | 
			
		||||
			return (1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Find session by name. */
 | 
			
		||||
struct session *
 | 
			
		||||
session_find(const char *name)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user