-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Disable Tty if run command started from a piped command #13233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…void confusion Signed-off-by: Guillaume Lours <[email protected]>
cmd/compose/run.go
Outdated
| } | ||
| } | ||
| //Check if the command was piped or not | ||
| stdinInfo, err := os.Stdin.Stat() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you use dockerCli.stdin().IsTerminal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
be34b30 to
b10d73b
Compare
Co-authored-by: Nicolas De loof <[email protected]> Signed-off-by: Guillaume Lours <[email protected]>
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=-->
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
