diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-06-27 02:56:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-06-27 02:56:59 +0000 |
commit | 07a71fd432df5873515da82d2d620ec0d986b558 (patch) | |
tree | a4a9064b09cfc31f1ec1f49adb7e1f7b8308eaed /tmux.c | |
parent | 26524c99f68959b5a0d1698529f332934061d424 (diff) | |
download | rtmux-07a71fd432df5873515da82d2d620ec0d986b558.tar.gz rtmux-07a71fd432df5873515da82d2d620ec0d986b558.tar.bz2 rtmux-07a71fd432df5873515da82d2d620ec0d986b558.zip |
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 'tmux.c')
-rw-r--r-- | tmux.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -239,7 +239,7 @@ main(int argc, char **argv) struct env_data envdata; struct msg_command_data cmddata; char *s, *shellcmd, *path, *label, *home, *cause; - char cwd[MAXPATHLEN], **var; + char **var; void *buf; size_t len; int opt, flags, quiet = 0, cmdflags = 0; @@ -339,6 +339,7 @@ main(int argc, char **argv) options_set_number(so, "bell-action", BELL_ANY); options_set_number(so, "buffer-limit", 9); options_set_string(so, "default-command", "%s", ""); + options_set_string(so, "default-path", "%s", ""); options_set_string(so, "default-shell", "%s", getshell()); options_set_string(so, "default-terminal", "screen"); options_set_number(so, "detach-on-destroy", 1); @@ -435,15 +436,6 @@ main(int argc, char **argv) options_set_number(wo, "utf8", 0); } - if (getcwd(cwd, sizeof cwd) == NULL) { - pw = getpwuid(getuid()); - if (pw->pw_dir != NULL && *pw->pw_dir != '\0') - strlcpy(cwd, pw->pw_dir, sizeof cwd); - else - strlcpy(cwd, "/", sizeof cwd); - } - options_set_string(so, "default-path", "%s", cwd); - if (cfg_file == NULL) { home = getenv("HOME"); if (home == NULL || *home == '\0') { |