rannn505 / child-shell

Node.js bindings 🔗 for shell
http://rannn505.github.io/child-shell/
MIT License
299 stars 71 forks source link

Buffer trim doesn't correctly trim EOL on windows #122

Closed krystofwoldrich closed 2 years ago

krystofwoldrich commented 4 years ago

This issue applies to the new version of the node-powershell that is currently being developed in the node-shell branch.

The issue appears when running the node-powershell on Windows.

Buffer-trim package trims white spaces like eol and space. But eol was platform-dependent, which on Unix based systems work fine. But windows emit both "\r\n" and Unix style "\n". So I've changed "\n" trimming not to be platform dependent.

Before the fix all commands and files resulted in error and shell result was just "\n". And the error flag was true.

How to replicate error, jut run examples on Windows.