fix: conditionally pass -t flag to docker exec based on TTY detection#2023
Merged
fix: conditionally pass -t flag to docker exec based on TTY detection#2023
Conversation
The -it flags were hardcoded in docker exec calls, causing "the input device is not a TTY" errors in non-interactive environments like CI/CD pipelines, IDE terminals, cron jobs, and piped shells. Now only passes -t when stdin is actually a terminal, while always keeping -i for stdin attachment. Fixes both AirflowCommand() (used by airflow_settings.yaml import for pools/connections/variables) and Bash() (used by astro dev bash). Closes #2022 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jeremybeard
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-itflags indocker execcalls that causedthe input device is not a TTYerrors in non-interactive environments (CI/CD, IDE terminals, cron, piped shells)-twhen appropriate, while always keeping-ifor stdin attachmentAirflowCommand()indocker/docker.go(used byairflow_settings.yamlimport for pools/connections/variables) andBash()inairflow/docker.go(used byastro dev bash)Closes #2022
Test plan
go build ./...compiles cleanlygo test ./docker/— 19 tests passgo test ./settings/— 27 tests passgo test ./airflow/— 150+ tests pass (includingTestUseBash)-tis correctly omitted, args areexec -i <container> bash -c <cmd>golang.org/x/termwas already ingo.modastro dev startwithairflow_settings.yamlpools/connections/variables in a CI-like environmentastro dev bashin an interactive terminal still works as before🤖 Generated with Claude Code