Disable Tty if run command started from a piped command#13233
Merged
glours merged 3 commits intodocker:mainfrom Sep 19, 2025
Merged
Disable Tty if run command started from a piped command#13233glours merged 3 commits intodocker:mainfrom
glours merged 3 commits intodocker:mainfrom
Conversation
…void confusion Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
ndeloof
reviewed
Sep 18, 2025
cmd/compose/run.go
Outdated
| } | ||
| } | ||
| //Check if the command was piped or not | ||
| stdinInfo, err := os.Stdin.Stat() |
Contributor
There was a problem hiding this comment.
why don't you use dockerCli.stdin().IsTerminal ?
Contributor
Author
There was a problem hiding this comment.
But unfortunately don't behave like the os.Stdin.Stat() check, it still have the the input device is not a TTY error when checking the cli stdin with IsTerminal
3abcff4 to
be34b30
Compare
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
be34b30 to
b10d73b
Compare
ndeloof
approved these changes
Sep 19, 2025
ndeloof
reviewed
Sep 19, 2025
Co-authored-by: Nicolas De loof <nicolas.deloof@gmail.com> Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Sep 22, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | patch | `v2.39.3` -> `v2.39.4` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v2.39.4`](https://github.com/docker/compose/releases/tag/v2.39.4) [Compare Source](docker/compose@v2.39.3...v2.39.4) #### What's Changed ##### ✨ Improvements - Add support of `develop.watch.initial_sync` attribute by [@​glours](https://github.com/glours) in [#​13232](docker/compose#13232) ##### 🐛 Fixes - Volume ls command can run without a project by [@​ndeloof](https://github.com/ndeloof) in [#​13221](docker/compose#13221) - Fix support for build with bake when target docker endpoint requires TLS by [@​ndeloof](https://github.com/ndeloof) in [#​13231](docker/compose#13231) - Disable Tty if `run` command started from a piped command by [@​glours](https://github.com/glours) in [#​13233](docker/compose#13233) ##### 🔧 Internal - Test: Set stop\_signal to SIGTERM by [@​ricardobranco777](https://github.com/ricardobranco777) in [#​13214](docker/compose#13214) ##### ⚙️ Dependencies - Bump `compose-go` to version `v2.9.0` by [@​glours](https://github.com/glours) in [#​13234](docker/compose#13234) #### New Contributors - [@​ricardobranco777](https://github.com/ricardobranco777) made their first contribution in [#​13214](docker/compose#13214) **Full Changelog**: <docker/compose@v2.39.3...v2.39.4> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTguMCIsInVwZGF0ZWRJblZlciI6IjQxLjExOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.


What I did
Checked if
runis started from a piped command such asecho test | docker compose run my-service, if this is the case and the user don't change any tty related flags then we automatically pass inno-Ttymode.Related issue
Fixes #13228
(not mandatory) A picture of a cute animal, if possible in relation to what you did
