diff --git a/bin/compose b/bin/compose index 56b49bd..8f01e94 100755 --- a/bin/compose +++ b/bin/compose @@ -1000,8 +1000,11 @@ run() { set -- "${cmd_args[@]}" fi - [ -t 0 ] && docker_run_opts+=("-i") - [ -t 1 ] && docker_run_opts+=("-t") + ## XXXvlab: can't see a place where we wouldn't want to link stdin + ## to internal process be it a terminal or not. + docker_run_opts+=("-i") + ## If stdin is a not a tty, then adding ``-t`` will fail + [ -t 0 -a -t 1 ] && docker_run_opts+=("-t") debug "${WHITE}Launching:${NORMAL}" if [ -n "$DEBUG" ] || [ -n "$DRY_RUN" ]; then diff --git a/bin/compose-core b/bin/compose-core index f141b95..74bf402 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -2677,7 +2677,7 @@ _run_service_action_direct() { export SERVICE_CONFIGSTORE="$CONFIGSTORE/$service" exname="$exname $ACTION_NAME $SERVICE_NAME" \ stdbuf -oL -eL bash -c 'charm.run_direct_action "$@"' -- "$charm" "$action" "$@" - ) + ) 0<&6 ## inject general stdin } export -f _run_service_action_direct @@ -2812,6 +2812,7 @@ export -f has_service_action run_service_action () { local service="$1" action="$2" shift ; shift + exec 6<&0 ## saving stdin { if ! read-0 action_type; then info "Service $DARKYELLOW$service$NORMAL does not have any action $DARKCYAN$action$NORMAL defined." @@ -2820,8 +2821,9 @@ run_service_action () { fi "_run_service_action_${action_type}" "$service" "$action" "$@" - } < <(has_service_action "$service" "$action") + + exec 0<&6 6<&- ## restoring stdin } export -f run_service_action