Skip to content

Commit

Permalink
main: fix a bug that error messages for unsupported shells are not pr…
Browse files Browse the repository at this point in the history
…inted
  • Loading branch information
akinomyoga committed Jul 22, 2019
1 parent 36312f7 commit 34bd6f8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
18 changes: 9 additions & 9 deletions ble.pp
Expand Up @@ -93,28 +93,28 @@
unset _ble_init_version
unset _ble_init_arg
unset _ble_init_exit
return 1 2>/dev/null || builtin exit 1
return 1 2>/dev/null || exit 1
fi
} 2>/dev/null # set -x 対策 #D0930

#------------------------------------------------------------------------------
# check shell

if [ -z "$BASH_VERSION" ]; then
echo "ble.sh: This shell is not Bash. Please use this script with Bash." >&2
return 1 2>/dev/null || builtin exit 1
fi >/dev/null 2>&1 # set -x 対策 #D0930
echo "ble.sh: This shell is not Bash. Please use this script with Bash." >&3
return 1 2>/dev/null || exit 1
fi 3>&2 >/dev/null 2>&1 # set -x 対策 #D0930

if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 3 ]; then
echo "ble.sh: Bash with a version under 3.0 is not supported." >&2
return 1 2>/dev/null || builtin exit 1
fi >/dev/null 2>&1 # set -x 対策 #D0930
echo "ble.sh: Bash with a version under 3.0 is not supported." >&3
return 1 2>/dev/null || exit 1
fi 3>&2 >/dev/null 2>&1 # set -x 対策 #D0930

if [[ $- != *i* ]]; then
{ ((${#BASH_SOURCE[@]})) && [[ ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} == *bashrc ]]; } ||
builtin echo "ble.sh: This is not an interactive session." >&2
builtin echo "ble.sh: This is not an interactive session." >&3
return 1 2>/dev/null || builtin exit 1
fi &>/dev/null # set -x 対策 #D0930
fi 3>&2 &>/dev/null # set -x 対策 #D0930

function ble/base/adjust-bash-options {
[[ $_ble_bash_options_adjusted ]] && return 1 || :
Expand Down
21 changes: 19 additions & 2 deletions memo.txt
Expand Up @@ -890,6 +890,10 @@ bash_tips
ToDo
-------------------------------------------------------------------------------

2019-07-22

* highlight: 入力した URL の最初の // だけが着色されるのは変な感じがする。

2019-07-18

* blehook: trap を置き換える?
Expand Down Expand Up @@ -993,6 +997,11 @@ bash_tips
それが使えればそれを使ってマウスを有効にするというのが可能になる気がする。
何れにしてもこれは考察が必要になるのである。

2019-07-22 どうも既存の端末では Shift を押しながら操作すると
Mouse report ではなくてローカルでの端末上でのマウス操作になる、
というのを採用している物が多い、という話を何処かで見かけた。
何処で見掛けたかは忘れたし実際にそうなのかの確認はしていないが。

2019-04-29

* bashbug: #D1078 の bash-5.0 のバグを報告する?
Expand Down Expand Up @@ -2219,7 +2228,7 @@ bash_tips
- util: introduce `blehook` `#D1139` d1a78fb
- blehook: support `blehook PRECMD PREEXEC POSTEXEC CHPWD ADDHISTORY` `#D1142` bedc2ba
- blehook: add `blehook/eval-after-load` `#D1145` c1f7aa9
- blehook: fix a bug that the definition of specified hooks are not printed `#D1146` 000000
- blehook: fix a bug that the definition of specified hooks are not printed `#D1146` a4a7cbc

Changes
- edit: erase in page on `SIGWINCH` `#D1016` 7625ebe
Expand Down Expand Up @@ -2247,7 +2256,7 @@ bash_tips
- highlight: do not split command names with `:` and `=` `#D1133` 8a1bd8f
- decode: support DA1 responses sent by some terminals (reported by miba072) `#D1135` 362ab05
- highlight: make brace expansions active for RHS of variable-assignment-form arguments `#D1138` 93cc8da
- main: adjust readline variables for `ble.sh` `#D1148` 0000000
- main: adjust readline variables for `ble.sh` `#D1148` 36312f7

Fixes
- decode: workaround Poderosa that returns `DSR` instead of `CPR` in reply to `DSR(6)` `#D1018` 8e22c17
Expand Down Expand Up @@ -2284,6 +2293,7 @@ bash_tips
- main: fix a bug that `source ble.sh --noattach` in `ble.sh` sessions hangs `#D1130` d35682a caa46c2
- syntax: workaround bashbug 3.1/3.2 that `eval` ending with <kbd>\ + LF</kbd> causes error messages `#D1132` a4b7e00
- term: workaround `cygwin` console glitches `#D1143` b79c35f `#D1144` ef19d17
- main: fix a bug that error messages for unsupported shells are not printed `#D1149` 0000000

Internal changes
- complete: isolate menu related codes `#D1029` 43bb074
Expand Down Expand Up @@ -3242,6 +3252,13 @@ bash_tips
Done (実装ログ)
-------------------------------------------------------------------------------

2019-07-22

* bash 2 でロードしてみた所 ble.sh がロードされないのは良いが、 [#D1149]
何のメッセージも表示されない。と思ったら set -x 対策として
標準出力・エラー出力を封じているのだった。
ble.sh からのエラーメッセージだけは表示する様に修正する。

2019-07-21

* 以下の設定に関してはもう ble.sh 側で勝手に弄っても良いのではないか? [#D1148]
Expand Down

0 comments on commit 34bd6f8

Please sign in to comment.