From aa2c24cb3b8b40cc6d81459265bbe5bb0adf945f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 22 Sep 2016 19:46:23 -0400 Subject: [PATCH 1/2] base/dockcross: Run docker using -t to support CTRL-C --- imagefiles/dockcross | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 7299c17..51cc2c8 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -179,7 +179,7 @@ fi #------------------------------------------------------------------------------ # Now, finally, run the command in a container # -docker run --rm \ +docker run -t --rm \ -v $PWD:/work \ $USER_IDS \ $FINAL_ARGS \ From af75453ed08dd9b9db0547590ae9829179a6adda Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 23 Sep 2016 11:33:29 -0400 Subject: [PATCH 2/2] base/dockcross: Run docker with "-ti" only if a tty or pts is attached This commit reverts f07ca00 (base: Do not add -i -t flags to run command by default) and ensure tty is available before specifying the flags. --- README.rst | 2 +- imagefiles/dockcross | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 9be40f6..c0995f2 100644 --- a/README.rst +++ b/README.rst @@ -211,7 +211,7 @@ Examples 4. ``dockcross bash -c '$CC test/C/hello.c -o hello'``: Build the *hello.c* file with the compiler identified with the ``CC`` environmental variable in the build environment. -5. ``dockcross --args -it bash``: Run an interactive shell in the build environment. +5. ``dockcross bash``: Run an interactive shell in the build environment. Note that commands are executed verbatim. If any shell processing for environment variable expansion or redirection is required, please use diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 51cc2c8..e7ef3c6 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -179,7 +179,8 @@ fi #------------------------------------------------------------------------------ # Now, finally, run the command in a container # -docker run -t --rm \ +tty -s && TTY_ARGS=-ti || TTY_ARGS= +docker run $TTY_ARGS --rm \ -v $PWD:/work \ $USER_IDS \ $FINAL_ARGS \