Repository navigation
fix(docker): do not give commands a PTY without a terminal - #461
Merged
Merged
Conversation
lyrixx
added a commit
to beberlei/metrics
that referenced
this pull request
Oct 21, 2026
From jolicode/docker-starter#461: without a terminal (CI, pipes, AI agents), a prompt in the container waited forever.
lyrixx
marked this pull request as draft
October 21, 2026 10:20
Since #453, docker_compose_run() and docker_compose_exec() keep the PTY of the context. Without a terminal (CI, pipes, AI agents...), the command gets a terminal nobody types in, and a prompt waits forever (e.g. composer audit asking to trust a plugin). The default context now gives a PTY only when stdin is a terminal, outside of a CI. A CTRL+C followed by a CTRL+D in the shell of `castor builder` no longer stops the task as interrupted: the shell exits with the code of its last command, 130, which Castor 1.9 takes for a CTRL+C. The terminal tests move from the workflow to `castor test:terminal`, and the tests of docker-starter to the `test` namespace. Castor 1.9 is required, for its detection of non-interactive environments.
lyrixx
force-pushed
the
fix-docker-pty-without-terminal
branch
from
October 21, 2026 11:55
84c20e7 to
58e5947
Compare
lyrixx
marked this pull request as ready for review
October 21, 2026 12:03
pyrech
approved these changes
Oct 21, 2026
lyrixx
added a commit
to jolicode/qotd
that referenced
this pull request
Oct 21, 2026
From jolicode/docker-starter#461: commands only get a PTY when someone can answer their prompts (stdin is a terminal, outside of a CI), otherwise a prompt waited forever. Castor 1.9.0 is now required, for the trapped signals of the interactive shells.
lyrixx
added a commit
to jolicode/monologue
that referenced
this pull request
Oct 21, 2026
From jolicode/docker-starter#461: commands only get a PTY when someone can answer their prompts (stdin is a terminal, outside of a CI), otherwise a prompt waited forever. Castor 1.9.0 is now required, for the trapped signals of the interactive shells.
This was referenced Oct 21, 2026
Merged
Merged
lyrixx
added a commit
to beberlei/metrics
that referenced
this pull request
Oct 21, 2026
From jolicode/docker-starter#461, replacing the previous fix: run() also got a PTY without a terminal, and a piped stdout lost it. Castor 1.9.0 is now required, for the trapped signals of the interactive shells.
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.
Since #453,
docker_compose_run()anddocker_compose_exec()keep the PTY of the context. Without a terminal (CI, pipes, AI agents...), the command gets a terminal nobody types in, and a prompt waits forever (e.g.composer auditasking to trust a plugin). The default context now gives a PTY only when stdin is a terminal, outside of a CI:castor init | tee init.logcan still answer the prompts.In the shell of
castor builder, a CTRL+C followed by a CTRL+D no longer ends with "has been interrupted": the shell exits with the code of its last command, 130, which Castor 1.9 takes for a CTRL+C.The terminal tests move from the workflow to
castor test:terminal(castor test:terminal:manuallists what to check by hand), and the tests of docker-starter to thetestnamespace. Castor 1.9 is required, for its detection of non-interactive environments (jolicode/castor#908).