From 85b90e8537e19bbf84abda3f6a6a55189bbea4aa Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 15 Jul 2018 16:30:54 +0200 Subject: [PATCH] job: disable backgrounding --- gash/job.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gash/job.scm b/gash/job.scm index 37f30f0..5220244 100644 --- a/gash/job.scm +++ b/gash/job.scm @@ -102,13 +102,15 @@ (let ((pgid (add-to-process-group job pid))) (set-job-pgid! job pgid) (stderr "job-add-process fg?=~a\n" fg?) - (when (and #f fg?) ;; FIXME + (when (and (isatty? (current-error-port)) + fg?) (tcsetpgrp (current-error-port) pgid)) (set-job-processes! job (cons (make-process pid command #f) (job-processes job))))) (define (job-setup-process fg? job) (when (isatty? (current-error-port)) - (when (and #f fg?) + (when (and (isatty? (current-error-port)) + fg?) (tcsetpgrp (current-error-port) (add-to-process-group job (getpid)))) (map (cut sigaction <> SIG_DFL) (list SIGINT SIGQUIT SIGTSTP SIGTTIN SIGTTOU SIGCHLD)))) @@ -116,7 +118,9 @@ (define (job-control-init) (when (isatty? (current-error-port)) (let ((pgid (getpgrp))) - (while (not (eqv? (tcgetpgrp (current-error-port)) pgid)) + (while (and #f ;; FIXME: make check backgrouds our tests + (isatty? (current-error-port)) + (not (eqv? (tcgetpgrp (current-error-port)) pgid))) (kill (- pgid) SIGTTIN))) ;; oops we are not in the foreground (map (cut sigaction <> SIG_IGN) (list SIGINT SIGQUIT SIGTSTP SIGTTIN SIGTTOU)) (sigaction SIGCHLD SIG_DFL)