Skip to content

Add exit support to repl #6457

Description

@tracker1

Just a nice to have feature request. It would be nice, if one could simply type exit and enter into the repl, and have it process.exit(0)

This would match up with most command-line interface repls, from bash to cmd, etc... and is second nature to type in. I'm not sure if this has been debated, as I didn't see an issue regarding this. As it stands, I can type exit\n faster than I can press ctrl+c twice.

Hopefully this feature is doable, and others can agree on the usefulness.

Alternatively to an immediate process.exit(0) would be process.nextTick(() => process.exit(0)) so that pending outputs can finish out.

Activity

  1. addaleax commented on Apr 29, 2016

    @addaleax
    Member

    .exit does what you want, I think.

  2. added
    questionIssues asking questions about Node.js.
    replIssues and PRs related to the REPL subsystem.
    on Apr 29, 2016
  3. evanlucas commented on Apr 29, 2016

    @evanlucas
    Contributor

    Or use Ctrl+d

  4. mscdex commented on Apr 29, 2016

    @mscdex
    Contributor

    As noted, there are existing solutions to this. Simply supporting exit would not work because that would mean reserving that keyword which is not really ideal (and .exit has existed for a long time and it is only one more character).

  5. jasnell commented on Apr 29, 2016

    @jasnell
    Member

    Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions