diff --git a/redo b/redo index 6e43a30..3a121da 100644 --- a/redo +++ b/redo @@ -241,17 +241,18 @@ EOT function _readkey { - typeset o=${1:-n} k + typeset o=${1:-n} k tmout=0.001 + [ "$KSH_VERSION" ] && tmout=1 IFS= read -rs${o}1 key [ "$key" = $'\x1b' ] && key="" && while true do k="" - read -rs${o}1 -t 0.001 k 2>/dev/null - [ $? = 1 ] && [ ! "$ZSH_VERSION" ] && read -rs${o}1 -t 1 k # old bash + read -rs${o}1 -t $tmout k 2>/dev/null + [ $? = 1 ] && [ "$BASH" ] && read -rs${o}1 -t 1 k # old bash [ ! "$k" ] && key=${key:-$'\x1b'} && break key+="$k" case "$key" in - '['[A-H]|'['*'~'|O[A-S]|'[1;2'[P-S]) break;; + '['[A-H]|'['*'~'|O[A-S]|'[1;2'[P-S]) break;; esac done printf "%s" "$key" @@ -299,8 +300,8 @@ function _domenu '[19~'|$'\x04'|'[3~') # F8 Ctl-D delete [ "$_delfunc" ] && $_delfunc "${_aitems[$_nsel]}" unset "_aitems[$_nsel]" - [ "$BASH" ] && _aitems=(_ "${_aitems[@]}") && unset '_aitems[0]' ||\ - _aitems=("${(@)_aitems[1,$_nsel-1]}" "${(@)_aitems[$_nsel+1,$nbitems]}") + [ "$ZSH_VERSION" ] && _aitems=("${(@)_aitems[1,$_nsel-1]}" "${(@)_aitems[$_nsel+1,$nbitems]}") ||\ + _aitems=(_ "${_aitems[@]}") && unset '_aitems[0]' nbitems=${#_aitems[@]} tput ed filter="";_select "$prompt" "$_nsel" "$nbitems" "$filter";;