We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dffda9 commit 7b58777Copy full SHA for 7b58777
1 file changed
utils/mail-in-ctr.sh
@@ -12,7 +12,9 @@ arg_quot () {
12
printf '%s' "$@" | sed "s/'/'\\\\''/g; s/.*/'&'/"
13
}
14
15
-if [ "$(getopt -T > /dev/null; echo $?)" -eq 4 ]; then
+if [ $# -eq 0 ] && [ -t 0 ]; then
16
+ : # interactive mode
17
+elif [ "$(getopt -T > /dev/null; echo $?)" -eq 4 ]; then
18
# sed is to strip the extra -- param
19
orig_opts=$(getopt -- '' -- "$@" | sed 's/^ *-- *//')
20
# convert -. and --end-options to --
@@ -80,4 +82,4 @@ else
80
82
echo "WARNING: $SELF_NAME: falling back to insecure parameter passing because this getopt is unsupported" >&2
81
83
fi
84
-exec ${CTR_EXEC_CMD:-podman exec} -i "$CTR_NAME" mail "$@"
85
+exec ${CTR_EXEC_CMD:-podman exec} -i $([ -t 0 ] && echo -t) "$CTR_NAME" mail "$@"
0 commit comments