Skip to content

Commit

Permalink
Prevent jobs from running
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
nviennot committed Jun 16, 2016
1 parent 033298c commit 0049a58
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions job.c
Expand Up @@ -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);

Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions status.c
Expand Up @@ -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) {
Expand Down
5 changes: 5 additions & 0 deletions window-copy.c
Expand Up @@ -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;
Expand Down

0 comments on commit 0049a58

Please sign in to comment.