vscode调试之控制台输入

自从开始看nodejs,深深感觉sublime在调试方面太不方便了,毕竟人家只是个编辑器啊你非要当IDE用@.@…

Anyway,刚嫌弃完sublime的下一秒我就装了VSCode,相比VS2010简直小清新啊哈哈哈

然而中午刷了道题发现对于需要控制台输入的代码不造怎么调试。。只能在shell下默默地打印关键数据 ==!

可是这样也超不方便,哪儿哪儿都要console.log,有时候console.log大法下还是看不出具体bug在哪

查了一下:

Documentation indicates: “VSC Debug Console does not support programs that need to read input from the console, you can enable an external, native console by setting the attribute externalConsole to true in your launch configuration.”

原来人家设计之初就是不支持从控制台读取输入的。。。

按照文档里说的在launch.json里加入"externalConsole": true,成功!