From a7f938591be364700bd59109d8d26d7ca3d0c501 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Tue, 3 Mar 2026 01:48:07 +0300 Subject: [PATCH] auto-detect non-interactive mode when no terminal is present chezmoi run_onchange scripts don't receive CLI arguments, so the --non-interactive flag only works when running the script directly. Now also checks if stdin/stdout are real terminals to auto-detect non-interactive contexts like Vagrant provisioning. Co-Authored-By: Claude Opus 4.6 --- run_onchange_after_install_main_deps.sh.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run_onchange_after_install_main_deps.sh.tmpl b/run_onchange_after_install_main_deps.sh.tmpl index b709648..5790f82 100644 --- a/run_onchange_after_install_main_deps.sh.tmpl +++ b/run_onchange_after_install_main_deps.sh.tmpl @@ -63,6 +63,11 @@ while [ $# -gt 0 ]; do shift done +# Auto-detect non-interactive mode when no real terminal is present +if [ ! -t 0 ] || [ ! -t 1 ]; then + NON_INTERACTIVE=1 +fi + # Timeout portability (macOS has gtimeout via coreutils, not timeout) TIMEOUT_BIN="$(command -v timeout || command -v gtimeout || true)"