From eb424cf63d0a4d0e9f8531ed8c4dab632725b0fe Mon Sep 17 00:00:00 2001
From: Nicholas Marriott <nicm@openbsd.org>
Date: Tue, 7 Jul 2009 06:58:49 +0000
Subject: [PATCH] Minor fix: look for default-path in the options for the
 specified session first rather than just the global options. From Brandon
 Mercer, thanks.

---
 cmd-new-window.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd-new-window.c b/cmd-new-window.c
index 7d3eeb45..30b84ac3 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -164,7 +164,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
 	if (cmd == NULL)
 		cmd = options_get_string(&s->options, "default-command");
 	if (ctx->cmdclient == NULL || ctx->cmdclient->cwd == NULL)
-		cwd = options_get_string(&global_options, "default-path");
+		cwd = options_get_string(&s->options, "default-path");
 	else
 		cwd = ctx->cmdclient->cwd;