lanoxx/tilda — pull request #74 by xsleonard (2014-07-27 01:06:58+00:00)
Title: Inherit working dir on new tab, fixes #68

Pids of child terms are saved on the `tilda_terminal` struct. This pid is used to get the working directory of the active terminal when creating a new tab, by looking at `/proc//cwd`. This working directory is passed to
`vte_terminal_fork_command_full` for initialization.

The function `tilda_term_get_cwd` is based on these:
https://github.com/skawouter/svte/blob/524835cb00cd8cc7653f72b21d3c266bd6ab50ce/svte.c#L169
https://github.com/mate-desktop/mate-terminal/blob/master/src/terminal-screen.c#L200

I don't know what your portability standards are, but I think it only works on Linux.

I've added a setting `inherit_working_dir` defaulted to `TRUE`, but have not exposed it to the user. Not sure where it should go in the Preferences UI or if it should be part of the CLI. If `FALSE` it will follow the old behavior, which was to use the `"working_dir"` config which can be NULL and vte will use tilda's working directory in that case.