postcss / postcss-cli

CLI for postcss
Other
824 stars 93 forks source link

only exit on watch if stdin is TTY #424

Closed ToppleTheNun closed 1 year ago

ToppleTheNun commented 2 years ago

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

RyanZim commented 2 years ago

This causes tests to fail; please investigate.

toastal commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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

0xradical commented 1 year ago

Hi @RyanZim , this is my attempt at fixing this issue: https://github.com/postcss/postcss-cli/pull/446.