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. Someday, I may rewrite readlineSync to use child_process.execSync, or safety module.
## Release History ## 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-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.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.). * 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 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 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 # printf '\n' >/dev/tty
else else
read LINE </dev/tty read LINE </dev/tty

View file

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

View file

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