aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-01-25 12:42:39 -0500
committerLeo Famulari <leo@famulari.name>2017-01-25 12:42:39 -0500
commitd123f2f991e0bf6f51e5f207d291fb4c1ceb1245 (patch)
tree8ca3cbeff8a08ab9e11a0324fd9ec0bae7614f4c /guix/scripts
parenta282d7ff174ccc13b3645359449af6052451c2a1 (diff)
parent864042c5c5f845fd3c1ae37c64dc1a672fedef28 (diff)
downloadgnu-guix-d123f2f991e0bf6f51e5f207d291fb4c1ceb1245.tar
gnu-guix-d123f2f991e0bf6f51e5f207d291fb4c1ceb1245.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/container/exec.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/scripts/container/exec.scm b/guix/scripts/container/exec.scm
index 10e70568cc..d6d267daff 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)))))))