heapwolf / prompt-sync

a synchronous prompt for node.js
MIT License
211 stars 42 forks source link

Does not error on non-TTYs #20

Closed vihanb closed 6 years ago

vihanb commented 8 years ago

Previously, this would error when run on some non-ttys as the setRawMode function wouldn't be available. I've simply wrapped all of those in process.stdout.isTTY property, which should prevent those errors from happening. Additionally some terminals use \r and others use \n, and others a combination of both. Now this should catch \n and \r. I haven't made any other changes I can remember. If I have I can revert them.

davidmarkclements commented 8 years ago

Hey @vihanb thanks for the PR!

Just on the license there, putting a license in the code copyrighting it yourself in a PR isn't really the done thing

@0x00A thoughts?

vihanb commented 8 years ago

@davidmarkclements The license is copied and pasted from the repo. I did not make a new one

vihanb commented 8 years ago

Oh, looks like I copied the license from the very similarly named sync-prompt repo. I'll remove it