mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Prefer PWD for current directory if present in client, from Wei Zhao in
GitHub issue 1183.
This commit is contained in:
8
client.c
8
client.c
@ -279,10 +279,10 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
|
||||
client_peer = proc_add_peer(client_proc, fd, client_dispatch, NULL);
|
||||
|
||||
/* Save these before pledge(). */
|
||||
if ((cwd = getcwd(path, sizeof path)) == NULL) {
|
||||
if ((cwd = find_home()) == NULL)
|
||||
cwd = "/";
|
||||
}
|
||||
if ((cwd = getenv("PWD")) == NULL &&
|
||||
(cwd = getcwd(path, sizeof path)) == NULL &&
|
||||
(cwd = find_home()) == NULL)
|
||||
cwd = "/";
|
||||
if ((ttynam = ttyname(STDIN_FILENO)) == NULL)
|
||||
ttynam = "";
|
||||
|
||||
|
Reference in New Issue
Block a user