From 8a3fd3c61a0b7030961ab2e370523942221af18b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 27 Aug 2017 16:40:13 +0100 Subject: [PATCH] Fix _dsh being interrupted by keyboard input, closing stdin --- aliases | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases b/aliases index cb4e5ba..29f80b4 100644 --- a/aliases +++ b/aliases @@ -189,7 +189,7 @@ _dsh() { usercmd="--user=$user " fi - if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" ]; then + if [ "$dowhat" = 'exec' -a -z "$(docker ps -q -f name="$host")" <&- ]; then echo "No such container $host" >&2 return 5 fi @@ -197,7 +197,7 @@ _dsh() { if [ -z "$prog" ]; then set -o pipefail for shell in bash sh; do - if shell_path="$(eval "docker $dowhat -ti $host which $shell" | sed 's|[\r\n]||g')"; then + if shell_path="$(eval "docker $dowhat $rm $host which $shell" <&- | sed 's|[\r\n]||g')"; then prog="$shell_path" break fi