summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-06-27 02:56:59 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-06-27 02:56:59 +0000
commit07a71fd432df5873515da82d2d620ec0d986b558 (patch)
treea4a9064b09cfc31f1ec1f49adb7e1f7b8308eaed /session.c
parent26524c99f68959b5a0d1698529f332934061d424 (diff)
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.
Diffstat (limited to 'session.c')
-rw-r--r--session.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/session.c b/session.c
index 65f8ef41..b164eef8 100644
--- a/session.c
+++ b/session.c
@@ -68,6 +68,8 @@ session_create(const char *name, const char *cmd, const char *cwd,
fatal("gettimeofday failed");
memcpy(&s->activity_time, &s->creation_time, sizeof s->activity_time);
+ s->cwd = xstrdup(cwd);
+
s->curw = NULL;
TAILQ_INIT(&s->lastw);
RB_INIT(&s->windows);
@@ -142,6 +144,7 @@ session_destroy(struct session *s)
while (!RB_EMPTY(&s->windows))
winlink_remove(&s->windows, RB_ROOT(&s->windows));
+ xfree(s->cwd);
xfree(s->name);
for (i = 0; i < ARRAY_LENGTH(&dead_sessions); i++) {