Skip to content

Copying then pasting text directly into node REPL freezes it - Windows #32999

Closed
@powershellwhizz

Description

@powershellwhizz

As subject says. It only happens with large amounts of text, maybe something in relation to the buffer size?

node version v12.16.2
64 bit Windows 10

  • Subsystem: none

What steps will reproduce the bug?

Open CMD, type "node" press enter to get the node repl. Now copy the below code, then right click in the node console to paste text. It will only paste the first line of code and freeze up node. It becomes completely unresponsive.

How often does it reproduce? Is there a required condition?

Everytime when the copied code seems to be over a certain size. Don't know what that size is but happens no matter what the code is. The sample code provided will replicate the issue.

What is the expected behavior?

All text is pasted and executed line by line like other copy and paste operations.

What do you see instead?

Node locks up after the first line of the copied text

Additional information

Sample code below. Here is a quick vid of node locking up as described above. https://streamable.com/ep7wqt The cursor just flashes but it is unresponsive to key strokes and doesn't do anything else.
NOTE; the code has been changed to take out the IP so IF does execute it will error as I just replaced some keywords with random text. Ignore this, the point of it is to show that it won't copy and paste past the first line, it will freeze.

//{"_id":"56aba3108d6d183da42403c2"}
//placeholder
const request = require('request');
var mongoose = require ("mongoose");
var lodash = require ("lodash");
var myFuncs = require("./functions");



var item_urls;
var options = {
    json: true
  };

var test = [] ;
function updateDB (){
    var url = "get stuff";


    request(url, options, (error, res, body) =>{
        if (error) {
            return console.log(error)
          };

          if (!error && res.statusCode == 200) {
            console.log("executing cb1");
            item_urls = body.payload.items;
            myFuncs.fixItemIDs (item_urls);
            var primes = item_urls.filter(item => item.item_name.includes("Strun Wraith Set")); 
            for (item in primes) 
            {
                let url = `https://get more stuff/v1/items/${primes[item].url_name}`;
               // console.log (url);
                request(url, options, (error, res, body) =>{
                    if (error) {
                        return console.log(error)
                      };

                      if (!error && res.statusCode == 200) {

                          console.log(`Getting item ${url}`);
                          test.push(body.payload.item);
                          myFuncs.fixItemIDs (test);
                      }
                    });

            };  
            console.log ("done");          


          };
    });
}

updateDB();

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions