Преглед изворни кода

Fixes pipe handling in container mode.

Closes #4599, #4460

- adds a way to provide options from env in both cases (tty & non tty)
- allocates TTY only if both stdin & stdout are TTYs
- enables interactive mode if stdin is not TTY

Signed-off-by: Arkadiusz Dzięgiel <[email protected]>
Arkadiusz Dzięgiel пре 7 година
родитељ
комит
7f9c042300
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      script/run/run.sh

+ 4 - 3
script/run/run.sh

@@ -47,10 +47,11 @@ if [ -n "$HOME" ]; then
 fi
 
 # Only allocate tty if we detect one
-if [ -t 1 ]; then
-    DOCKER_RUN_OPTIONS="-t"
-fi
 if [ -t 0 ]; then
+    if [ -t 1 ]; then
+        DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -t"
+    fi
+else
     DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i"
 fi