diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2011-12-09 16:37:29 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2011-12-09 16:37:29 +0000 |
commit | c1b994852594b23b7443e01e05257c991684ba4e (patch) | |
tree | 7cbfc1dbdeff8197e63167dee96200d122a1be72 /cmd-new-window.c | |
parent | 76862acf3e8ebd3573c1b9415b32731891e5545a (diff) | |
download | rtmux-c1b994852594b23b7443e01e05257c991684ba4e.tar.gz rtmux-c1b994852594b23b7443e01e05257c991684ba4e.tar.bz2 rtmux-c1b994852594b23b7443e01e05257c991684ba4e.zip |
Change the way the working directory for new processes is discovered. If
default-path isn't empty, it is used. Otherwise:
1) If tmux neww is run from the command line, the working directory of the
client is used.
2) Otherwise use some platform specific code to retrieve the current working
directory of the process in the active pane.
3) If that fails, the directory where the session was created is used.
Idea and support code, Linux, Solaris, FreeBSD bits by Romain Francoise,
OpenBSD bits by me.
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index 065e2b1f..30ddd643 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -98,13 +98,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) cmd = options_get_string(&s->options, "default-command"); else cmd = args->argv[0]; - 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; - } + cwd = cmd_get_default_path(ctx); if (idx == -1) idx = -1 - options_get_number(&s->options, "base-index"); |