mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Add a helper function to send ready message.
This commit is contained in:
		@@ -94,7 +94,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
				
			|||||||
		ctx->cmdclient->session = s;
 | 
							ctx->cmdclient->session = s;
 | 
				
			||||||
		notify_attached_session_changed(ctx->cmdclient);
 | 
							notify_attached_session_changed(ctx->cmdclient);
 | 
				
			||||||
		session_update_activity(s);
 | 
							session_update_activity(s);
 | 
				
			||||||
		server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
 | 
							server_write_ready(ctx->cmdclient);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		update = options_get_string(&s->options, "update-environment");
 | 
							update = options_get_string(&s->options, "update-environment");
 | 
				
			||||||
		environ_update(update, &ctx->cmdclient->environ, &s->environ);
 | 
							environ_update(update, &ctx->cmdclient->environ, &s->environ);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -231,7 +231,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (!detached) {
 | 
						if (!detached) {
 | 
				
			||||||
		if (ctx->cmdclient != NULL) {
 | 
							if (ctx->cmdclient != NULL) {
 | 
				
			||||||
			server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
 | 
								server_write_ready(ctx->cmdclient);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			old_s = ctx->cmdclient->session;
 | 
								old_s = ctx->cmdclient->session;
 | 
				
			||||||
			if (old_s != NULL)
 | 
								if (old_s != NULL)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,6 +46,12 @@ server_fill_environ(struct session *s, struct environ *env)
 | 
				
			|||||||
	environ_set(env, "TMUX", var);
 | 
						environ_set(env, "TMUX", var);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					server_write_ready(struct client *c)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						server_write_client(c, MSG_READY, NULL, 0);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
server_write_client(
 | 
					server_write_client(
 | 
				
			||||||
    struct client *c, enum msgtype type, const void *buf, size_t len)
 | 
					    struct client *c, enum msgtype type, const void *buf, size_t len)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1743,6 +1743,7 @@ void	 server_window_loop(void);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* server-fn.c */
 | 
					/* server-fn.c */
 | 
				
			||||||
void	 server_fill_environ(struct session *, struct environ *);
 | 
					void	 server_fill_environ(struct session *, struct environ *);
 | 
				
			||||||
 | 
					void	 server_write_ready(struct client *);
 | 
				
			||||||
int	 server_write_client(
 | 
					int	 server_write_client(
 | 
				
			||||||
	     struct client *, enum msgtype, const void *, size_t);
 | 
						     struct client *, enum msgtype, const void *, size_t);
 | 
				
			||||||
void	 server_write_session(
 | 
					void	 server_write_session(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user