From 0049a585b38c804eccc663a6c4b4dcd663dbc7ad Mon Sep 17 00:00:00 2001 From: Nicolas Viennot Date: Thu, 16 Jun 2016 00:19:16 -0400 Subject: [PATCH] Prevent jobs from running Fixes #25 --- job.c | 6 ++++-- status.c | 4 ++++ window-copy.c | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/job.c b/job.c index 90685dbd..1f1e7c44 100644 --- a/job.c +++ b/job.c @@ -49,6 +49,10 @@ job_run(const char *cmd, struct session *s, const char *cwd, int nullfd, out[2]; const char *home; +#ifdef TMATE_SLAVE + return NULL; +#endif + if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0) return (NULL); @@ -65,9 +69,7 @@ job_run(const char *cmd, struct session *s, const char *cwd, close(out[1]); return (NULL); case 0: /* child */ -#ifndef TMATE_SLAVE clear_signals(1); -#endif if (cwd == NULL || chdir(cwd) != 0) { if ((home = find_home()) == NULL || chdir(home) != 0) diff --git a/status.c b/status.c index fcb3a579..5d421c0d 100644 --- a/status.c +++ b/status.c @@ -530,6 +530,10 @@ status_print(struct client *c, struct winlink *wl, time_t t, const char *fmt; char *text; +#ifdef TMATE_SLAVE + /* TODO use the host winlink status */ +#endif + style_apply_update(gc, oo, "window-status-style"); fmt = options_get_string(oo, "window-status-format"); if (wl == s->curw) { diff --git a/window-copy.c b/window-copy.c index 1ec8a45e..c6c0b552 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1407,6 +1407,11 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess, struct format_tree *ft; char *expanded; +#ifdef TMATE_SLAVE + /* that job_run() is not going to end well */ + return; +#endif + buf = window_copy_get_selection(wp, &len); if (buf == NULL) return;