Skip to content
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

only exit on watch if stdin is TTY #424

Closed
wants to merge 1 commit into from

Conversation

ToppleTheNun
Copy link

@ToppleTheNun ToppleTheNun commented Jan 18, 2022

check if stdin is TTY before checking "end" event,
as non-TTY stdin will always invoke end and exit.

found from running "postcss -w" in a docker container (#370)
and running "postcss -w" in lerna or turborepo.

closes #426

@ToppleTheNun ToppleTheNun marked this pull request as ready for review January 18, 2022 13:13
@RyanZim
Copy link
Collaborator

RyanZim commented Jan 21, 2022

This causes tests to fail; please investigate.

stdin's end event is fired immediately if stdin is
not a TTY
@toastal
Copy link

toastal commented May 8, 2022

Could be related to https://github.com/sindresorhus/get-stdin/blob/main/index.js#L4= short-circuit. Endemic to Node projects, there's no reason to be including a dependency for these 8 lines of code that come from process.stdin.

@nickcluc
Copy link

nickcluc commented Oct 12, 2022

Curious to know if this PR is dead? Running into this same issue with Rails-7 & postcss when we use foreman and background the foreman process. Thanks!

Note: the same fix here fixes that issue.

@RyanZim
Copy link
Collaborator

RyanZim commented Oct 12, 2022

@nickcluc PR welcome that fixes this issue without breaking the test suite.

@0xradical
Copy link
Contributor

Hi @RyanZim , this is my attempt at fixing this issue: #446.

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.

postcss-cli 9.1.0 watch cannot be run without tty
5 participants