Skip to content

Respect non interactive sessions - #114

Merged
matiboux merged 2 commits into
mainfrom
fix/respect-non-interactive-sessions
Aug 29, 2026
Merged

matiboux merged 2 commits into
mainfrom
fix/respect-non-interactive-sessions

Conversation

@matiboux

Copy link
Copy Markdown
Owner

This pull request improves how the dockerc script determines whether to allocate interactive and TTY flags when running Docker Compose commands. The main change is the introduction of a new function to more robustly detect interactive sessions, ensuring that flags like -i and -t are only used when appropriate.

Session detection improvements:

  • Added a new is_interactive_session function to check if the session is interactive by verifying both the DEBIAN_FRONTEND environment variable and whether stdin/stdout are TTYs.

Compose run argument handling:

  • Updated handle_compose_presets_run() to only add the -i (interactive) and -t (TTY) flags if the session is interactive, preventing errors when running in non-interactive environments.

Fixes #113

Auto-drop -i/-t on `docker compose run` when dockerc is invoked
without a tty (stdin/stdout redirected, CI, cron) or with
DEBIAN_FRONTEND=noninteractive set, so shell presets (@sh, @bash,
@zsh, @ash, @$) and the 'i'/'t' run preset flags no longer hang or
error out in non-interactive environments.
@matiboux matiboux self-assigned this Aug 29, 2026
@matiboux
matiboux merged commit 6470ecb into main Aug 29, 2026
1 check failed
@matiboux
matiboux deleted the fix/respect-non-interactive-sessions branch August 29, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect non interactive sessions

1 participant