diff --git a/ble-core.sh b/ble-core.sh index a114212c..05e78ab9 100644 --- a/ble-core.sh +++ b/ble-core.sh @@ -523,8 +523,6 @@ fi ## @param[in] command... ## 実行するコマンドを指定します。 ## -_ble_util_read_stdout_tmp="$_ble_base_run/$$.ble_util_assign.tmp" - _ble_util_assign_base=$_ble_base_run/$$.util.assign.tmp _ble_util_assign_level=0 if ((_ble_bash>=40000)); then @@ -568,7 +566,7 @@ else local _ble_local_ret=$? TMOUT= IFS= builtin read -r -d '' "$1" < "$_ble_local_tmpfile" ble/util/assign/.rmtmp - builtin eval "$1=\${$1%$_ble_term_nl}" + builtin eval "$1=\${$1%\$_ble_term_nl}" return "$_ble_local_ret" } fi diff --git a/ble-decode.sh b/ble-decode.sh index 6bd44817..744e2f07 100644 --- a/ble-decode.sh +++ b/ble-decode.sh @@ -1743,7 +1743,7 @@ function ble-decode-bind/.generate-source-to-unbind-default/.process { function ble-decode/bind { local file=$_ble_base_cache/ble-decode-bind.$_ble_bash.$bleopt_input_encoding.bind - [[ -s $file && $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh" + [[ -s $file && $file -nt $_ble_base/bind.sh ]] || source "$_ble_base/bind.sh" # * 一時的に 'set convert-meta off' にする。 # diff --git a/ble-edit.sh b/ble-edit.sh index 77766ecc..e5f4f7b8 100644 --- a/ble-edit.sh +++ b/ble-edit.sh @@ -723,7 +723,7 @@ function ble-edit/draw/trace/process-csi-sequence { # HVP "CSI f" local -a params ble/string#split-words params "${param//[^0-9]/ }" - params=("${params[@]/#/10#}") + params=("${params[@]/#/10#0}") ((x=params[1]-1)) ((y=params[0]-1)) ((x<0&&(x=0),x>=cols&&(x=cols-1), @@ -7194,7 +7194,7 @@ function ble-edit/bind/.check-detach { ble/textarea#render ble/util/buffer.flush >&2 if ((_ble_bash>=40000)); then - READLINE_LINE=' stty sane;' READLINE_POINT=10 + READLINE_LINE=' stty sane;' READLINE_POINT=11 printf %s "$READLINE_LINE" fi fi diff --git a/ble.pp b/ble.pp index 6dbafe68..a0dcbec0 100644 --- a/ble.pp +++ b/ble.pp @@ -52,7 +52,7 @@ _ble_bash=$((BASH_VERSINFO[0]*10000+BASH_VERSINFO[1]*100+BASH_VERSINFO[2])) if [ "$_ble_bash" -lt 30000 ]; then - unset _ble_bash + unset -v _ble_bash echo "ble.sh: bash with a version under 3.0 is not supported." >&2 return 1 2>/dev/null || exit 1 fi @@ -67,21 +67,24 @@ esac if ((BASH_SUBSHELL)); then + unset -v _ble_bash builtin echo "ble.sh: ble.sh cannot be loaded into a subshell." >&2 return 1 2>/dev/null || builtin exit 1 elif [[ $- != *i* ]]; then + unset -v _ble_bash case " ${BASH_SOURCE[*]##*/} " in (*' .bashrc '* | *' .bash_profile '* | *' .profile '* | *' bashrc '* | *' profile '*) false ;; esac && builtin echo "ble.sh: This is not an interactive session." >&2 || ((1)) return 1 2>/dev/null || builtin exit 1 elif ! [[ -t 0 && -t 1 ]]; then + unset -v _ble_bash builtin echo "ble.sh: cannot find the correct TTY/PTY in this session." >&2 return 1 2>/dev/null || builtin exit 1 fi if [[ -o posix ]]; then - unset _ble_bash + unset -v _ble_bash echo "ble.sh: ble.sh is not intended to be used in bash POSIX modes (--posix)." >&2 return 1 2>/dev/null || exit 1 fi @@ -117,13 +120,13 @@ function ble/restore-bash-options { bind &>/dev/null # force to load .inputrc if [[ ! -o emacs && ! -o vi ]]; then - unset _ble_bash + unset -v _ble_bash echo "ble.sh: ble.sh is not intended to be used with the line-editing mode disabled (--noediting)." >&2 return 1 fi if shopt -q restricted_shell; then - unset _ble_bash + unset -v _ble_bash echo "ble.sh: ble.sh is not intended to be used in restricted shells (--restricted)." >&2 return 1 fi diff --git a/cmap/default.sh b/cmap/default.sh index 0d606f88..33d6f7fc 100644 --- a/cmap/default.sh +++ b/cmap/default.sh @@ -81,6 +81,7 @@ function ble-bind-function-key+default { # ble-bind --csi '6~' next # 順番を固定 + local ret ble-decode-kbd/.gen-keycode insert ble-decode-kbd/.gen-keycode home ble-decode-kbd/.gen-keycode prior diff --git a/test/benchmark/benchmark-array-is-array.sh b/test/benchmark/benchmark-array-is-array.sh index 9a8cdc76..e6df2a14 100644 --- a/test/benchmark/benchmark-array-is-array.sh +++ b/test/benchmark/benchmark-array-is-array.sh @@ -35,8 +35,8 @@ ble-measure 'ble/is-array2 arr' # 1439.90 usec/eval # 3 compgen -A arrayvar を用いる方法 (完全) function ble/is-array3 { - compgen -A arrayvar "$1" >| "$_ble_util_read_stdout_tmp" 2>/dev/null || return 1 - local REPLY; read -r < "$_ble_util_read_stdout_tmp" + compgen -A arrayvar "$1" >| "$_ble_util_assign_base" 2>/dev/null || return 1 + local REPLY; read -r < "$_ble_util_assign_base" [[ $REPLY == "$1" ]] }