diff options
| author | Marius Bakke | 2017-02-13 22:35:05 +0100 |
|---|---|---|
| committer | Marius Bakke | 2017-02-13 22:35:05 +0100 |
| commit | 424b1ae76901c538457bd3c30d9d9cf67e79855f (patch) | |
| tree | acc35c1160625618cd6083e728c6a4ff7e9cccc9 /guix/scripts/container/exec.scm | |
| parent | a50e03014177d2f00b5b85d3e1c295406f842016 (diff) | |
| parent | eae2dbd47ac1f4a201b8584e2f88c30cd28e093a (diff) | |
Merge branch 'master' into python-tests
Diffstat (limited to 'guix/scripts/container/exec.scm')
| -rw-r--r-- | guix/scripts/container/exec.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/scripts/container/exec.scm b/guix/scripts/container/exec.scm index 10e70568c..d6d267daf 100644 --- a/guix/scripts/container/exec.scm +++ b/guix/scripts/container/exec.scm @@ -74,7 +74,14 @@ and the other containing arguments for the command to be executed." (let* ((opts (parse-command-line args %options '(()) #:argument-handler handle-argument)) - (pid (assoc-ref opts 'pid))) + (pid (assoc-ref opts 'pid)) + (environment (filter-map (lambda (name) + (let ((value (getenv name))) + (and value (cons name value)))) + ;; Pass through the TERM environment + ;; variable to inform processes about + ;; the capabilities of the terminal. + '("TERM")))) (unless pid (leave (_ "no pid specified~%"))) @@ -89,6 +96,10 @@ and the other containing arguments for the command to be executed." (lambda () (match command ((program . program-args) + (for-each (match-lambda + ((name . value) + (setenv name value))) + environment) (apply execlp program program program-args))))))) (unless (zero? result) (leave (_ "exec failed with status ~d~%") result))))))) |