From 4e5de356b1a0b068b86108374699585b725a591a Mon Sep 17 00:00:00 2001 From: Andi Dittrich Date: Sat, 17 Dec 2016 19:43:34 +0000 Subject: [PATCH] Terminal in non-TTY mode caused fatal error on connect #23 --- .gitignore | 0 CHANGES.md | 3 +++ CONTRIBUTE.md | 0 LICENSE.md | 0 README.md | 0 bin/nodemcu-tool.js | 0 docs/Examples.md | 0 docs/ProgrammaticUsage.md | 0 docs/Reset_on_Connect.md | 0 docs/nodemcu-reset-circuit.jpg | Bin examples/apache-ant-build.xml | 0 examples/parse-devicelist.py | 0 examples/parse-filelist.php | 0 helloworld.lua | 0 lib/LuaCommandBuilder.js | 0 lib/LuaOptimizer.js | 0 lib/NodeMCU-Tool.js | 0 lib/NodeMcuConnector.js | 0 lib/ScriptableSerialTerminal.js | 0 lib/SerialTerminal.js | 5 ++++- nodemcu-tool | 0 package.json | 2 +- video.gif | Bin 23 files changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 CHANGES.md mode change 100644 => 100755 CONTRIBUTE.md mode change 100644 => 100755 LICENSE.md mode change 100644 => 100755 README.md mode change 100644 => 100755 bin/nodemcu-tool.js mode change 100644 => 100755 docs/Examples.md mode change 100644 => 100755 docs/ProgrammaticUsage.md mode change 100644 => 100755 docs/Reset_on_Connect.md mode change 100644 => 100755 docs/nodemcu-reset-circuit.jpg mode change 100644 => 100755 examples/apache-ant-build.xml mode change 100644 => 100755 examples/parse-devicelist.py mode change 100644 => 100755 examples/parse-filelist.php mode change 100644 => 100755 helloworld.lua mode change 100644 => 100755 lib/LuaCommandBuilder.js mode change 100644 => 100755 lib/LuaOptimizer.js mode change 100644 => 100755 lib/NodeMCU-Tool.js mode change 100644 => 100755 lib/NodeMcuConnector.js mode change 100644 => 100755 lib/ScriptableSerialTerminal.js mode change 100644 => 100755 lib/SerialTerminal.js mode change 100644 => 100755 nodemcu-tool mode change 100644 => 100755 package.json mode change 100644 => 100755 video.gif diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/CHANGES.md b/CHANGES.md old mode 100644 new mode 100755 index f42a2c0..b7f043d --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +### 2.0.3 ### +Bugfix: Terminal in **non-TTY** mode caused fatal error on connect - thanks to [stephanMettler on GitHub](https://github.com/AndiDittrich/NodeMCU-Tool/issues/23) #23 + ### 2.0.2 ### Bugfix: Upload command failed because of API changes in NodeMCU Firmware **v1.5.4** - thanks to [curioussavage on GitHub](https://github.com/AndiDittrich/NodeMCU-Tool/issues/22) ##2 Bugfix: Fix crash when trying to upload a folder - thanks to [sakisds on GitHub](https://github.com/AndiDittrich/NodeMCU-Tool/pull/20) #20 diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md old mode 100644 new mode 100755 diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/bin/nodemcu-tool.js b/bin/nodemcu-tool.js old mode 100644 new mode 100755 diff --git a/docs/Examples.md b/docs/Examples.md old mode 100644 new mode 100755 diff --git a/docs/ProgrammaticUsage.md b/docs/ProgrammaticUsage.md old mode 100644 new mode 100755 diff --git a/docs/Reset_on_Connect.md b/docs/Reset_on_Connect.md old mode 100644 new mode 100755 diff --git a/docs/nodemcu-reset-circuit.jpg b/docs/nodemcu-reset-circuit.jpg old mode 100644 new mode 100755 diff --git a/examples/apache-ant-build.xml b/examples/apache-ant-build.xml old mode 100644 new mode 100755 diff --git a/examples/parse-devicelist.py b/examples/parse-devicelist.py old mode 100644 new mode 100755 diff --git a/examples/parse-filelist.php b/examples/parse-filelist.php old mode 100644 new mode 100755 diff --git a/helloworld.lua b/helloworld.lua old mode 100644 new mode 100755 diff --git a/lib/LuaCommandBuilder.js b/lib/LuaCommandBuilder.js old mode 100644 new mode 100755 diff --git a/lib/LuaOptimizer.js b/lib/LuaOptimizer.js old mode 100644 new mode 100755 diff --git a/lib/NodeMCU-Tool.js b/lib/NodeMCU-Tool.js old mode 100644 new mode 100755 diff --git a/lib/NodeMcuConnector.js b/lib/NodeMcuConnector.js old mode 100644 new mode 100755 diff --git a/lib/ScriptableSerialTerminal.js b/lib/ScriptableSerialTerminal.js old mode 100644 new mode 100755 diff --git a/lib/SerialTerminal.js b/lib/SerialTerminal.js old mode 100644 new mode 100755 index 67ec782..96cee5c --- a/lib/SerialTerminal.js +++ b/lib/SerialTerminal.js @@ -50,7 +50,10 @@ SerialTerminal.prototype.passthrough = function(devicename, baudrate, cb){ }else{ // prepare - process.stdin.setRawMode(true); + if (process.stdin.isTTY){ + process.stdin.setRawMode(true); + } + process.stdin.setEncoding('utf8'); // pass-through diff --git a/nodemcu-tool b/nodemcu-tool old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 2833909..389411d --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodemcu-tool", - "version": "2.0.2", + "version": "2.0.3", "description": "Command line tool to upload and manage files on your NodeMCU / ESP8266 Module.", "keywords": [ "cli", diff --git a/video.gif b/video.gif old mode 100644 new mode 100755