fixed #9: Error of stty in read.sh.

This commit is contained in:
anseki 2014-09-12 23:23:04 +09:00
parent 5fe64de8ab
commit d406cc1c19
4 changed files with 9 additions and 7 deletions

View file

@ -169,6 +169,7 @@ Why did I choose it? :
Someday, I may rewrite readlineSync to use child_process.execSync, or safety module.
## Release History
* 2014-09-12 v0.4.8 fixed #9: Error of `stty` in read.sh.
* 2014-07-13 v0.4.3 fixed #6: Crypto input data.
* 2014-07-12 v0.4.2 `setPrompt()` and `setEncoding()` return current value.
* 2014-07-12 v0.4.1 `setPrompt()` and `question()` accept the value which is not string too (e.g. number, Date, Object, etc.).

View file

@ -1,7 +1,7 @@
if [ "$1" = "noechoback" ]; then
stty -F /dev/tty -echo echonl
stty --file=/dev/tty -echo echonl || stty -F /dev/tty -echo echonl || stty -f /dev/tty -echo echonl || exit 1
read LINE </dev/tty
stty -F /dev/tty echo -echonl
stty --file=/dev/tty echo -echonl || stty -F /dev/tty echo -echonl || stty -f /dev/tty echo -echonl
# printf '\n' >/dev/tty
else
read LINE </dev/tty

View file

@ -104,11 +104,12 @@ function _readlineShell(noEchoBack) {
} else {
shellPath = '/bin/sh';
args = ['-c',
'(' + shellPath + ' "' + __dirname + '/read.sh"' + optEchoBack + ')' +
' |"' + process.execPath + '" "' + __dirname + '/encrypt.js"' +
'DATA=`(' + shellPath + ' "' + __dirname + '/read.sh"' + optEchoBack + ')`; RTN=$?;' +
' if [ $RTN -eq 0 ]; then (echo $DATA |' +
'"' + process.execPath + '" "' + __dirname + '/encrypt.js"' +
' "' + ALGORITHM_CIPHER + '" "' + password + '"' +
' >"' + pathStdout + '";' +
' echo $? >"' + pathStatus + '"; echo 1 >"' + pathDone + '"'];
' >"' + pathStdout + '") fi;' +
' expr $RTN + $? >"' + pathStatus + '"; echo 1 >"' + pathDone + '"'];
}
stdin.pause(); // re-start in child process

View file

@ -1,7 +1,7 @@
{
"name": "readline-sync",
"description": "Synchronous Readline",
"version": "0.4.7",
"version": "0.4.8",
"homepage": "https://github.com/anseki/readline-sync",
"author": {
"name": "anseki"