From 0c938fdd0893724b7e00f1fc6870599889d23dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Oufella?= Date: Wed, 28 Feb 2024 00:19:36 -0500 Subject: [PATCH] condition docker pty allocation on stderr too This allows a better identification of when a pseudo tty should be allocated (see #125 for details). --- cqfd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cqfd b/cqfd index 809c57e..501d5da 100755 --- a/cqfd +++ b/cqfd @@ -172,9 +172,11 @@ docker_run() { args+=(--rm --log-driver=none) - # interactive options if standard input is connected to a tty + # always keep stdin open args+=(-i) - if tty -s; then + + # allocate a pty if stdin/err are connected to a tty + if [ -t 0 ] && [ -t 2 ]; then args+=(-t) fi