Coder Social home page Coder Social logo

repl-client's Issues

exit using CTRL-D leaves STDIN in raw-mode

One possible fix might be:

--- repl-client.js~     2014-03-25 05:35:55.000000000 +0000
+++ repl-client.js      2018-10-12 16:26:58.984608789 +0000
@@ -41,6 +41,8 @@
 process.stdin.on('data', function watchForEOT(buffer) {
   if (buffer.length === 1 && buffer[0] === 4) { // EOT (end-of-transmission) Ctrl-D
     console.log() // provide graceful line break
+    if (process.stdin.setRawMode)
+      process.stdin.setRawMode(false)
     process.stdin.emit('end')
   }
 })

Doesn't work for Node 0.10.x

_stream_readable.js:694
throw new Error('Cannot switch to old mode now.');
^
Error: Cannot switch to old mode now.
at emitDataEvents (_stream_readable.js:694:11)
at ReadStream.Readable.resume (_stream_readable.js:679:3)
at Socket. (/Users/alexandruvladutu/.nvm/v0.10.3/lib/node_modules/repl-client/repl-client.js:40:17)
at Socket.EventEmitter.emit (events.js:117:20)
at Object.afterConnect as oncomplete

name of the executable

This tool is nice. We use it at work. A now departed colleague set it up.

However, not knowing that and seeing that 'repl-client' was never referenced in the code, I suppressed the dependency.

A month later, we struggled to understand to what some rarely-used production procedures were refering to while trying to access the cryptic rc...

A search of "node rc" on google returned a LOT of misleading stuff.

I humbly suggest to rename "rc" to "repl-client" to avoid such confusion. It would be clearer and coherent with the package name. 9 chars is nothing compared to precious time wasted.

Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.