From 4ad0c3022edbf1088ce2e7cd5eedfdc865b505fe Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Sat, 24 Jan 2015 20:00:06 -0800 Subject: [PATCH] use tty cmd to detect if we have one. closes #921 --- plugins/00_dokku-standard/commands | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 9c1819ee5..9358641a4 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -49,8 +49,8 @@ case "$1" in shift 2 DOCKER_ARGS=$(: | pluginhook docker-args $APP run) - # if we have a prompt, then we have a tty according to the LDP (http://www.tldp.org/LDP/abs/html/intandnonint.html) - [[ ! -z "$PS1" ]] && DOKKU_RUN_OPTS="-i -t" + [[ "$(/usr/bin/tty || true)" != "not a tty" ]] && DOKKU_RUN_OPTS="-i -t" + docker run $DOKKU_RUN_OPTS $DOCKER_ARGS $IMAGE /exec "$@" ;;