Change: print \n
whith read -s
This commit is contained in:
parent
fc50c96368
commit
7a37871966
2 changed files with 3 additions and 5 deletions
|
@ -11,8 +11,7 @@ silent_read() {
|
||||||
if [ "$1" = "noechoback" ]; then
|
if [ "$1" = "noechoback" ]; then
|
||||||
# Try `-s` option. *ksh have it that not `--silent`. Therefore, don't try it.
|
# Try `-s` option. *ksh have it that not `--silent`. Therefore, don't try it.
|
||||||
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
||||||
IFS= read -rs INPUT </dev/tty 2>/dev/null || silent_read
|
IFS= read -rs INPUT </dev/tty 2>/dev/null && printf '\n' >/dev/tty || silent_read
|
||||||
printf '\n' >/dev/tty
|
|
||||||
else
|
else
|
||||||
silent_read
|
silent_read
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -238,11 +238,10 @@ exports.question = function(query, options) {
|
||||||
options);
|
options);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.keyIn = function(message) {
|
exports.keyIn = function(query) {
|
||||||
return _readlineSync(
|
return _readlineSync(
|
||||||
/* jshint eqnull:true */
|
/* jshint eqnull:true */
|
||||||
message != null ? message : '',
|
query != null ? query : '',
|
||||||
/* jshint eqnull:false */
|
/* jshint eqnull:false */
|
||||||
{keyIn: true});
|
{keyIn: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue