mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Store the current working directory in the session, change the default-path
option to default to empty and make that mean that the stored session CWD is used.
This commit is contained in:
		@@ -176,10 +176,13 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
	cmd = data->cmd;
 | 
			
		||||
	if (cmd == NULL)
 | 
			
		||||
		cmd = options_get_string(&s->options, "default-command");
 | 
			
		||||
	if (ctx->cmdclient == NULL || ctx->cmdclient->cwd == NULL)
 | 
			
		||||
		cwd = options_get_string(&s->options, "default-path");
 | 
			
		||||
	else
 | 
			
		||||
		cwd = ctx->cmdclient->cwd;
 | 
			
		||||
	cwd = options_get_string(&s->options, "default-path");
 | 
			
		||||
	if (*cwd == '\0') {
 | 
			
		||||
		if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
 | 
			
		||||
			cwd = ctx->cmdclient->cwd;
 | 
			
		||||
		else
 | 
			
		||||
			cwd = s->cwd;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (idx == -1)
 | 
			
		||||
		idx = -1 - options_get_number(&s->options, "base-index");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user