Skip to content

Commit

Permalink
util: suppress false warnings of "bind" inside non-interactive shells
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 9, 2022
1 parent f9db7d8 commit 82c9934
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.sh
Expand Up @@ -2153,7 +2153,7 @@ function ble/util/reset-keymap-of-editing-mode {

## 関数 ble/util/test-rl-variable name [default_exit]
function ble/util/test-rl-variable {
local rl_variables; ble/util/assign rl_variables 'builtin bind -v'
local rl_variables; ble/util/assign rl_variables 'builtin bind -v 2>/dev/null'
if [[ $rl_variables == *"set $1 on"* ]]; then
return 0
elif [[ $rl_variables == *"set $1 off"* ]]; then
Expand All @@ -2168,7 +2168,7 @@ function ble/util/test-rl-variable {
## 関数 ble/util/read-rl-variable name [default_value]
function ble/util/read-rl-variable {
ret=$2
local rl_variables; ble/util/assign rl_variables 'builtin bind -v'
local rl_variables; ble/util/assign rl_variables 'builtin bind -v 2>/dev/null'
local rhs=${rl_variables#*$'\n'"set $1 "}
[[ $rhs != "$rl_variables" ]] && ret=${rhs%%$'\n'*}
}
Expand Down

0 comments on commit 82c9934

Please sign in to comment.