Skip to content

FR: CodeBlocks in REPL. #20817

Description

@hemanth
$ node --version
v10.0.0

$ uname
Darwin LM-BNG-22004407 16.7.0 Darwin Kernel Version 16.7.0

So, today:

$ node

> obj = {
... 
... 
... }

# If we hit the up arrow key, we see
> }

> obj = {

Rather, if we could display the entire code block, when we do an up arrow, like:

$ node

> obj = {
... 
... 
... }

# If we hit the up arrow key, we must see

> obj = {}

This should make life on the REPL much easier.

Very similar to how devtool console treats code blocks.

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    feature requestIssues requesting new Node.js features.
    on May 18, 2018
  2. bnoordhuis commented on May 18, 2018

    @bnoordhuis
    Member

    I'm fairly sure this has been discussed before but I can't find the issue.

    The problem with your suggestion is that you won't be able to edit code blocks anymore since the REPL is line-oriented. It's not a text editor where you can move up and down. (Not counting ed.)

  3. AyushG3112 commented on May 18, 2018

    @AyushG3112
    Contributor

    @bnoordhuis can't we trim the newlines from the code block to make sure that the block shows up on a single line? That's what the mongoDB REPL does, and is quite convenient.

  4. targos commented on May 18, 2018

    @targos
    Member

    Shells like bash or zsh can do that:

    https://asciinema.org/a/lBGxcTTxXoGGhPmhARMAt0CsG

    Is it an option for Node?

  5. bnoordhuis commented on May 18, 2018

    @bnoordhuis
    Member

    @AyushG3112 I don't think so. ASI means JS code with and without newlines doesn't necessarily behave the same.

  6. hemanth commented on May 20, 2018

    @hemanth
    ContributorAuthor

    Agree that we won't be able to edit it, but it would make this easier to tracking what was done, maybe we need to copy the block or we are demoing something on REPL...

  7. antsmartian commented on Nov 4, 2018

    @antsmartian
    Contributor

    This got fixed : #22153 and landed in master. Was surprised, I didn't notice this issue before (I saw the problem myself and fixed it :)). We can close this now.

  8. hemanth commented on Nov 4, 2018

    @hemanth
    ContributorAuthor

    @antsmartian Awesome! We can try this on nightly, I guess.

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

    feature requestIssues requesting new Node.js features.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