Skip to content

Commit

Permalink
Merge pull request #7098 from freedomofpress/better-tty
Browse files Browse the repository at this point in the history
Only pass -it to Docker if we have a tty
  • Loading branch information
legoktm authored Jan 2, 2024
2 parents 531d086 + d134e19 commit ed6142d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion securedrop/bin/dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ function docker_run() {
ci_env=""
fi

# Pass -it if we're a tty
if test -t 0; then
DOCKER_RUN_ARGUMENTS="${DOCKER_RUN_ARGUMENTS} -it"
fi

# The --shm-size argument sets up dedicated shared memory for the
# container. Our tests can fail with the default of 64m.
$DOCKER_BIN run $ci_env \
Expand All @@ -130,7 +135,7 @@ function docker_run() {
--volume "${TOPLEVEL}:${TOPLEVEL}:Z" \
--workdir "${TOPLEVEL}/securedrop" \
--name "${SD_CONTAINER}" \
-ti $DOCKER_RUN_ARGUMENTS "${1}" "${@:2}"
$DOCKER_RUN_ARGUMENTS "${1}" "${@:2}"
}

image="securedrop-slim-focal-py3"
Expand Down

0 comments on commit ed6142d

Please sign in to comment.