postcss-cli icon indicating copy to clipboard operation
postcss-cli copied to clipboard

only exit on watch if stdin is TTY

Open ToppleTheNun opened this issue 2 years ago • 4 comments

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 avatar Jan 18 '22 04:01 ToppleTheNun

This causes tests to fail; please investigate.

RyanZim avatar Jan 21 '22 01:01 RyanZim

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.

toastal avatar May 08 '22 06:05 toastal

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.

nickcluc avatar Oct 12 '22 18:10 nickcluc

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

RyanZim avatar Oct 12 '22 19:10 RyanZim

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

0xradical avatar Nov 28 '22 17:11 0xradical