aboutsummaryrefslogtreecommitdiff
path: root/tmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tmux.c b/tmux.c
index ada0bb4a..64d50743 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.90 2009-01-10 19:35:40 nicm Exp $ */
+/* $Id: tmux.c,v 1.91 2009-01-10 19:37:35 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -178,7 +178,7 @@ main(int argc, char **argv)
const char *shell;
struct passwd *pw;
char *path, *cause, *home;
- char rpath[MAXPATHLEN];
+ char rpath[MAXPATHLEN], cwd[MAXPATHLEN];
int n, opt, flags;
flags = 0;
@@ -305,6 +305,12 @@ main(int argc, char **argv)
&global_options, "default-command", "exec %s", shell);
+ if (getcwd(cwd, sizeof cwd) == NULL) {
+ log_warn("getcwd");
+ exit(1);
+ }
+ options_set_string(&global_options, "default-path", "%s", cwd);
+
if (argc == 0) {
cmd = xmalloc(sizeof *cmd);
cmd->entry = &cmd_new_session_entry;