mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Add a helper function to open the terminal for attach-/new-session.
This commit is contained in:
		@@ -63,7 +63,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
	struct termios		 tio, *tiop;
 | 
			
		||||
	struct passwd		*pw;
 | 
			
		||||
	const char		*newname, *target, *update, *cwd, *errstr;
 | 
			
		||||
	char			*overrides, *cmd, *cause;
 | 
			
		||||
	char			*cmd, *cause;
 | 
			
		||||
	int			 detached, idx;
 | 
			
		||||
	u_int			 sx, sy, i;
 | 
			
		||||
 | 
			
		||||
@@ -128,14 +128,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
 | 
			
		||||
	/* Open the terminal if necessary. */
 | 
			
		||||
	if (!detached && ctx->cmdclient != NULL) {
 | 
			
		||||
		if (!(ctx->cmdclient->flags & CLIENT_TERMINAL)) {
 | 
			
		||||
			ctx->error(ctx, "not a terminal");
 | 
			
		||||
			return (-1);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		overrides =
 | 
			
		||||
		    options_get_string(&global_s_options, "terminal-overrides");
 | 
			
		||||
		if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) {
 | 
			
		||||
		if (server_client_open(ctx->cmdclient, NULL, &cause) != 0) {
 | 
			
		||||
			ctx->error(ctx, "open terminal failed: %s", cause);
 | 
			
		||||
			xfree(cause);
 | 
			
		||||
			return (-1);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user