From e481faf1b909f265cc2b3f45e605dad8842f5ec5 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 17 Feb 2026 12:23:20 -0800 Subject: [PATCH] client: lib_docker: `exec`: silence noise when not debugging --- client/src/docker/lib/internal/lib_docker.bash | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/docker/lib/internal/lib_docker.bash b/client/src/docker/lib/internal/lib_docker.bash index 9e6b596..581962c 100644 --- a/client/src/docker/lib/internal/lib_docker.bash +++ b/client/src/docker/lib/internal/lib_docker.bash @@ -510,9 +510,21 @@ function lib_docker::__shell() function lib_docker::__exec() { + [ -z "$DOCKER_FINANCE_DEBUG" ] && lib_utils::die_fatal + + # Allocate pseudo-TTY, if needed + # NOTE: interactive is kept for cases in which the passed command requires it local _tty test -t 1 && _tty="t" - docker exec -i"$_tty" "$global_container" /bin/bash -i -c "$@" + + local -r _exec=("docker" "exec" "-i$_tty" "$global_container" "/bin/bash" "-i" "-c" "$@") + if [ "$DOCKER_FINANCE_DEBUG" -eq 0 ]; then + # Silence `bash: cannot set terminal process group (-1): Inappropriate ioctl for device` + # NOTE: lib_utils error handling will still function as expected + "${_exec[@]}" 2>/dev/null + else + "${_exec[@]}" + fi } function lib_docker::__parse_args_edit()