@alanbem/dclaude 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dclaude +11 -5
- package/package.json +1 -1
package/dclaude
CHANGED
|
@@ -817,16 +817,22 @@ handle_git_auth() {
|
|
|
817
817
|
}
|
|
818
818
|
|
|
819
819
|
# Detect TTY availability and return appropriate Docker flags
|
|
820
|
+
# Detect TTY status early (before any subshells)
|
|
821
|
+
# Must be done at script top-level since $() subshells don't inherit TTY
|
|
822
|
+
STDIN_IS_TTY=false
|
|
823
|
+
STDOUT_IS_TTY=false
|
|
824
|
+
[[ -t 0 ]] && STDIN_IS_TTY=true
|
|
825
|
+
[[ -t 1 ]] && STDOUT_IS_TTY=true
|
|
826
|
+
|
|
820
827
|
detect_tty_flags() {
|
|
821
828
|
local tty_flags=""
|
|
822
829
|
|
|
823
|
-
#
|
|
824
|
-
if [[
|
|
830
|
+
# Use pre-detected TTY status (can't detect inside subshell)
|
|
831
|
+
if [[ "$STDIN_IS_TTY" == "true" ]]; then
|
|
825
832
|
tty_flags="-i"
|
|
826
833
|
fi
|
|
827
834
|
|
|
828
|
-
|
|
829
|
-
if [[ -t 1 ]]; then
|
|
835
|
+
if [[ "$STDOUT_IS_TTY" == "true" ]]; then
|
|
830
836
|
tty_flags="${tty_flags} -t"
|
|
831
837
|
fi
|
|
832
838
|
|
|
@@ -834,7 +840,7 @@ detect_tty_flags() {
|
|
|
834
840
|
tty_flags=$(echo $tty_flags | xargs)
|
|
835
841
|
|
|
836
842
|
if [[ "$DEBUG" == "true" ]]; then
|
|
837
|
-
debug "TTY detection: stdin=$
|
|
843
|
+
debug "TTY detection: stdin=$STDIN_IS_TTY, stdout=$STDOUT_IS_TTY"
|
|
838
844
|
debug "TTY flags: ${tty_flags:-none}"
|
|
839
845
|
fi
|
|
840
846
|
|