version 1.56, 2011/06/05 11:19:03 |
version 1.57, 2011/12/09 16:28:18 |
|
|
|
|
return (buf); |
return (buf); |
} |
} |
|
|
|
/* Return the default path for a new pane. */ |
|
char * |
|
cmd_get_default_path(struct cmd_ctx *ctx) |
|
{ |
|
char *cwd; |
|
struct session *s; |
|
struct window_pane *wp; |
|
|
|
if ((s = cmd_current_session(ctx, 0)) == NULL) |
|
return (NULL); |
|
|
|
cwd = options_get_string(&s->options, "default-path"); |
|
if (*cwd == '\0') { |
|
if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL) |
|
return (ctx->cmdclient->cwd); |
|
if (ctx->curclient != NULL) { |
|
wp = s->curw->window->active; |
|
if ((cwd = get_proc_cwd(wp->pid)) != NULL) |
|
return (cwd); |
|
} |
|
return (s->cwd); |
|
} |
|
return (cwd); |
|
} |