Comments (9)
Hi @ozanmuyes, thank you for the information. 😄
from readline-sync.
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.
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.
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.
@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.
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.
No reply came, then this abandoned issue is closed.
from readline-sync.
This error occured when i run above code using nodemon.But it didnt happen when I run using node.
from readline-sync.
Hi @lallumohan, thank you for the comment.
These may help you:
#90
#77
from readline-sync.
Related Issues (20)
- question does not print the expected character HOT 4
- looking for help in building the console application with syntax highlight HOT 9
- Non-ASCII Character Issues HOT 9
- `hideEchoBack: true` disables backspace. HOT 3
- Is there any way to take multi-line input? HOT 6
- Error on Windows when input is redirected HOT 9
- Chinese character problem HOT 12
- Allow movements like in bash terminal (Left, Right) HOT 9
- Read a markdown file line by line in sync HOT 23
- Multiple select HOT 5
- Can't distinguish between EOD and a blank input line HOT 9
- a qusetion about encoding HOT 4
- Other code cannot be run HOT 3
- "Assertion `(argc) == (5)' failed." error on calling functions HOT 8
- readline-sync does not print special/unicode chars, bu tusing normal console.log() works fine HOT 2
- node.js may crash on windows 10 when console in/out is redirected HOT 3
- keypress event not firing after keyInSelect HOT 2
- Adding a default answer option to keyInYN* HOT 5
- Cannot redirect standard input HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from readline-sync.