From 7f9c042300e023f63ca76449b893ade64355c290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Dzi=C4=99giel?= Date: Tue, 24 Jul 2018 12:21:37 +0200 Subject: [PATCH] Fixes pipe handling in container mode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- script/run/run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/run/run.sh b/script/run/run.sh index 52ff9513f..fe253875e 100755 --- a/script/run/run.sh +++ b/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