diff --git a/env/rust.scm b/env/rust.scm index 8c9837e..7177697 100644 --- a/env/rust.scm +++ b/env/rust.scm @@ -79,7 +79,10 @@ function." (let* ((_ (reload-module (resolve-module '(guix scripts environment)))) (launch (@@ (guix scripts environment) launch-environment/container)) (setup-fhs (@@ (guix scripts environment) setup-fhs)) - (tcgrp (tcgetpgrp (current-input-port)))) + (tcgrp (catch 'system-error + ;; catching ioctl for some types of prompts. + (λ () (tcgetpgrp (current-input-port))) + (const #f)))) ;; during launch-environment/container does at least one fork take place, ;; for some reason when child exits this process receives SIGTTOU and ;; SIGTTIN signals which put it to wait. Looks like a side-effect of hacks @@ -105,7 +108,10 @@ function." ;; for the terminal used by input port changed after child ;; exits. That causes input/output error when we jump back to ;; the prompt. - (tcsetpgrp (current-input-port) tcgrp) + (when tcgrp + ;; only setting it back when there were no ioctl error (see let* + ;; form above) + (tcsetpgrp (current-input-port) tcgrp)) ;; Why not? (flush-all-ports)))))