Change the way the working directory for new processes is discovered. If
commitf308ba93aae9de462b1b46e68b47bd77a843eed6
authorNicholas Marriott <nicm@openbsd.org>
Fri, 9 Dec 2011 16:28:18 +0000 (9 16:28 +0000)
committerNicholas Marriott <nicm@openbsd.org>
Fri, 9 Dec 2011 16:28:18 +0000 (9 16:28 +0000)
tree82ecdeedd7bf7c532a161cb0d79328ff5de85cb0
parente04d13f6a6591351b1184e7801604137f6a72b1d
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 sysctl KERN_PROC_CWD is used 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.

Support code by Romain Francois, OpenBSD specific bits by me.

Note this requires a recent userland and kernel with KERN_PROC_CWD.
cmd-new-window.c
cmd-split-window.c
cmd.c
procname.c
tmux.1
tmux.h