Repository navigation
v0.5.0
⚠️ Breaking: env replaces the child's environment
env is now the child's whole environment, as in node-pty, instead of being merged over the parent's. Variables you leave out, such as tokens, no longer reach the child (#47).
If you pass a partial map and rely on inheriting the rest, spread process.env:
spawn("bash", [], { name: "xterm-256color", env: { ...process.env, FOO: "bar" } });If you already pass { ...process.env, ... } or no env, nothing changes for you.
Changed
envreplaces the environment (#48)- Without
env, the child gets the currentprocess.env, so changes made at runtime reach it - When the map has no
PATH, a bare program name such asshis still found with the parent'sPATH, which does not reach the child - On Windows, a map with no entries keeps the parent's environment, as in node-pty
- Without
- The child's environment is built as node-pty builds it on Unix (#49)
TERMis set from thenameoption, which was ignored before, then fromTERMin the environment, then "xterm"PWDis set fromcwd- When the child inherits
process.env, the parent's tmux and screen variables (TMUX,STY, ...) and itsCOLUMNSandLINESare dropped
IPtyForkOptions.nameis optional, andenv: process.envnow type-checks (#49)
Thanks to @zgeoff for the report and the contribution!