  	if (init_pty(argv, statusfd) < 0)
  	{
  		if (statusfd != -1)
-@@ -485,6 +608,7 @@ master_process(int s, char **argv, int w
+@@ -485,6 +622,7 @@ master_process(int s, char **argv, int w
  			printf("%s: init_pty: %s\n", progname, strerror(errno));
  		exit(1);
  	}

 	/* Window size change request, without a forced redraw. */
 	else if (pkt.type == MSG_WINCH)
 	{
@@ -443,8 +507,6 @@ client_activity(struct client *p)
 	}
 }
 

 			if (p->attached)
 				new_has_attached_client = 1;
 		}
@@ -561,26 +704,109 @@ master_process(int s, char **argv, int w
 		}
 
 		/* Wait for something to happen. */
