Skip to content

Commit

Permalink
condition docker pty allocation on stderr too
Browse files Browse the repository at this point in the history
This allows a better identification of when a pseudo tty should be
allocated (see #125 for details).
  • Loading branch information
joufellasfl committed Feb 28, 2024
1 parent c620807 commit 0c938fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cqfd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0c938fd

Please sign in to comment.