mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Pick up cwd from environment,.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: cmd-new-window.c,v 1.26 2008-12-10 20:25:41 nicm Exp $ */
|
||||
/* $Id: cmd-new-window.c,v 1.27 2009-01-10 19:37:35 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -115,7 +115,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
struct cmd_new_window_data *data = self->data;
|
||||
struct session *s;
|
||||
struct winlink *wl;
|
||||
char *cmd;
|
||||
char *cmd, *cwd;
|
||||
int idx;
|
||||
|
||||
if (data == NULL)
|
||||
@ -137,8 +137,12 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
|
||||
cmd = data->cmd;
|
||||
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");
|
||||
else
|
||||
cwd = ctx->cmdclient->cwd;
|
||||
|
||||
wl = session_new(s, data->name, cmd, idx);
|
||||
wl = session_new(s, data->name, cmd, cwd, idx);
|
||||
if (wl == NULL) {
|
||||
ctx->error(ctx, "command failed: %s", cmd);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user