summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-09-27 07:43:19 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-09-27 07:43:19 +0000
commit6f7bc89d769069ae8c1c19fc47cb66fdded03937 (patch)
tree9d042f0acf92cd3211a2a399bc00a74b9ac18685 /usr.bin/tmux
parent19daaef9efa380d612a2f25449846be6a1ec55ff (diff)
Use same working directory rules for jobs as new windows rather than
always starting in home, GitHub issue 1488.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/format.c5
-rw-r--r--usr.bin/tmux/job.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index e158941e09a..6f0288620c0 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.162 2018/08/27 11:03:34 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.163 2018/09/27 07:43:18 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -297,7 +297,8 @@ format_job_get(struct format_tree *ft, const char *cmd)
t = time(NULL);
if (fj->job == NULL && (force || fj->last != t)) {
- fj->job = job_run(expanded, NULL, NULL, format_job_update,
+ fj->job = job_run(expanded, NULL,
+ server_client_get_cwd(ft->client, NULL), format_job_update,
format_job_complete, NULL, fj, JOB_NOWAIT);
if (fj->job == NULL) {
free(fj->out);
diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c
index 62503e23770..7c09420396e 100644
--- a/usr.bin/tmux/job.c
+++ b/usr.bin/tmux/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.51 2018/08/23 18:39:12 nicm Exp $ */
+/* $OpenBSD: job.c,v 1.52 2018/09/27 07:43:18 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -80,6 +80,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)
return (NULL);
+ log_debug("%s: cmd=%s, cwd=%s", __func__, cmd, cwd);
/*
* Do not set TERM during .tmux.conf, it is nice to be able to use