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

Add --watch=always option to prevent exit when stdin closes #9966

Merged
merged 3 commits into from
Nov 29, 2022

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Nov 29, 2022

Fixes #9870

We were trying our best to not need an option for this but there are too many scenarios where one behavior works for a tool and the other one does not.

In general, exiting when stdin closes is still the only reliable way to guarantee a process actually exits appropriately when orphaned because the OS / kernel itself will close the file handle associated with stdin. But, in certain scenarios, stdin isn't wired up in the first place. For instance:

  • Turborepo does this (or did at one point — not sure if it has been changed yet)
  • Bash does this when running commands in the background ONLY when not in an interactive shell

@thecrypticace thecrypticace merged commit 1d23dcb into master Nov 29, 2022
@thecrypticace thecrypticace deleted the fix/stdin-closing-option branch November 29, 2022 19:57
KaelenProctor added a commit to KaelenProctor/CubeCobra that referenced this pull request Oct 31, 2024
such as when running in the background in a non-interactive shell (such
as in docker).

See tailwindlabs/tailwindcss#9966 for details.
KaelenProctor added a commit to KaelenProctor/CubeCobra that referenced this pull request Oct 31, 2024
such as when running in the background in a non-interactive shell (such
as in docker).

See tailwindlabs/tailwindcss#9966 for details.
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.

--watch doesn't work in background
1 participant