Comments (14)
🐒
from cross-env.
Yep, for Windows anyways. Don't have OSX/Linux to test with
from cross-env.
Thanks for reporting this. Would you be willing to makeapullrequest.com to fix it?
from cross-env.
Hm, maybe, I'm not quite sure how best to handle it. Quick untested idea:
const signals = ['SIGTERM', 'SIGINT', 'SIGPIPE', 'SIGBREAK', 'SIGWINCH'];
function crossEnv(args) {
// Stuff
signals.forEach((signal) => {
process.on(signal, (...eventArgs) => proc.emit.apply(proc, eventArgs));
});
}
Though that won't proxy other events and needs to be updated if Node adds more signals
from cross-env.
I'm fine with that approach. Is there any internal module we can use that has that list of signals so we don't have to update in the future?
from cross-env.
If not, I'm good hardcoding it and keeping it updated.
from cross-env.
There isn't a built-in event list that I can see no. However, I find it unlikely that they'll add signals, since it's just following the standard POSIX
signaling spec
from cross-env.
Another option would be to use something like https://github.com/asyncly/EventEmitter2 and wrap process
, or, injecting process.emit
with a function call to patch the event through
from cross-env.
you're suggesting using onAny
from EventEmitter2
? Seems interesting. Though I think I actually like monkey-patching process.emit
a little better.
from cross-env.
Yes, though I think using EventEmitter2
is a bit overkill for this
from cross-env.
Agreed. Let's monkey-patch process.emit
👍
from cross-env.
I'll get a PR up later this week, need to fix the tests
from cross-env.
So while testing various things on how best to do this (also wanted to see about proxy'ing all events) I've noticed that the current version of the module actually leaves zombie processes behind, as the child
process isn't killed when the parent process is killed (at least on Windows).
Seems it's because Windows sends a SIGINT
signal on kill usually, rather than SIGTERM
Gonna PR for adding all the kill signals then, then see how to handle all events.
The way the tests are set up makes it a bit tricky to test, especially with the way Node handles exit
events, so I'm not sure I can get to 100% tested, but we'll see..
from cross-env.
I've noticed that the current version of the module actually leaves zombie processes behind
So this is resolved as part of your merged PR too right?
from cross-env.
Related Issues (20)
- issue with nodejs in windows HOT 1
- PATH variable replacement on Windows envirement HOT 3
- No custom variable available without REACT_APP_ prefix HOT 1
- Passing url parameter on windows breaks HOT 1
- Processing variables on MacOS 10.15.2 only works with single quotes HOT 4
- cross-env should exit with non-zero code when terminated by Ctrl-C (SIGINT) HOT 5
- v7.0.1 leaves processes hanging on Windows HOT 1
- Cannot find module 'isexe' HOT 2
- Angular compilation problem HOT 1
- How to run cross-env from powershell in Windows? HOT 1
- Imports failing with "cannot locate symbol" error for wheels built on Ubuntu, deployed on aarch64 Android HOT 3
- More than 3 parent directories (..) in path ignored on Windows HOT 2
- Cross-env-shell in Windows via Npx doesn't handle multiple commands properly HOT 1
- Command causing cross-shell-env to fail silently HOT 2
- No cross-platform way of setting environment values containing spaces HOT 1
- cypress install no_proxy not working ? HOT 2
- Variables empty HOT 2
- The automated release is failing 🚨
- Fresh Laravel v8.12 install, node.js - TypeError: commandConvert is not a function HOT 1
- cross-env is "finished" (now in maintenance mode) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cross-env.