Giter Club home page Giter Club logo

Comments (9)

anseki avatar anseki commented on June 7, 2024 1

Hi @ozanmuyes, thank you for the information. 😄

from readline-sync.

JunyuanChen avatar JunyuanChen commented on June 7, 2024

This issue was originally reported to NodeJS at nodejs/node#41223.

There have been similar issue reports before, #106 #92 .

This does not appear to be an issue with TTYs. Even if proper terminal emulators are used, it will still error out on Windows.
Furthermore, this should not trigger a v8 panic and crash the entire node process. nodejs/node#41223 (comment) mentioned that the problem is caused by using process.binding().

from readline-sync.

anseki avatar anseki commented on June 7, 2024

Hi @PianoMan7, @JunyuanChen, thank you for the comment.
As document says, readlineSync is a library to read/write via TTY.
Therefore, you have to use another library or a method for VS Code.

from readline-sync.

JunyuanChen avatar JunyuanChen commented on June 7, 2024

readlineSync is a library to read/write via TTY. Therefore, you have to use another library or a method for VS Code.

The problem here is that apparently process.binding('tty_wrap').TTY node v16 on Windows crashes the entire node process when the returned object is used. Even with a proper terminal emulator (eg. mintty), it will still crash and dump a v8 (!) stack trace. This means that there is no way to try-catch since it is crashing v8.

In lib/readline-sync.js, there are statements like if (IS_WIN) so I assume this library does intend to support Windows?

from readline-sync.

anseki avatar anseki commented on June 7, 2024

@JunyuanChen, your issue seems to be different from this issue. That is an issue about redirection, it's not VS Code.
Anyway, you have to use another library because fs.c doesn't work now.

from readline-sync.

ozanmuyes avatar ozanmuyes commented on June 7, 2024

Adding "console": "externalTerminal" to launch.json works for me, like in the launch configuration below;

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-node",
      "request": "launch",
      "name": "dev",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "console": "externalTerminal",
      "program": "${workspaceFolder}/index.js",
      "args": ["..."],
    }
  ]
}

PS: I'm on Mac. And of course expect some shell window to open by the configuration above.

from readline-sync.

anseki avatar anseki commented on June 7, 2024

No reply came, then this abandoned issue is closed.

from readline-sync.

lallumohan avatar lallumohan commented on June 7, 2024

This error occured when i run above code using nodemon.But it didnt happen when I run using node.

from readline-sync.

anseki avatar anseki commented on June 7, 2024

Hi @lallumohan, thank you for the comment.
These may help you:
#90
#77

from readline-sync.

Related Issues (20)

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.