Use pgrp of pty fd not pid of immediate child when recovering current

working directory (like current process). From Marcel Partap.
This commit is contained in:
Nicholas Marriott
2012-09-24 13:05:10 +00:00
parent eb0ad181e9
commit 42272dfbd5
4 changed files with 8 additions and 6 deletions

2
cmd.c
View File

@ -1298,7 +1298,7 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd)
if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
root = ctx->cmdclient->cwd;
else if (ctx->curclient != NULL && s->curw != NULL)
root = get_proc_cwd(s->curw->window->active->pid);
root = get_proc_cwd(s->curw->window->active->fd);
else
return (s->cwd);
skip = 0;