環境
OS: macOS Monterey
zplug: 2.4.2
zplugでの設定
下記のような設定でfzfを使用していました。
# fzf
zplug "junegunn/fzf-bin", \
from:gh-r, \
as:command, \
rename-to:fzf
export FZF_DEFAULT_OPTS='--height 50% --reverse --border'
function select-history() {
BUFFER=$(history -n -r 1 | fzf --no-sort +m --query "$LBUFFER" --prompt="History > ")
CURSOR=$#BUFFER
}
zle -N select-history
bindkey '^r' select-history
エラーの内容
macOSをMontereyにアップデート後,fzfを使用すると下記のようなエラーがでました。
fatal error: runtime: bsdthread_register error
runtime stack:
runtime.throw(0x1168a0f, 0x21)
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:605 +0x95 fp=0x7ff7bfefea00 sp=0x7ff7bfefe9e0 pc=0x1028165
runtime.goenvs()
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/os_darwin.go:108 +0x83 fp=0x7ff7bfefea30 sp=0x7ff7bfefea00 pc=0x1025a03
runtime.schedinit()
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/proc.go:492 +0xa1 fp=0x7ff7bfefea70 sp=0x7ff7bfefea30 pc=0x102ab41
runtime.rt0_go(0x7ff7bfefeaa0, 0x1, 0x7ff7bfefeaa0, 0x1000000, 0x1, 0x7ff7bfefee10, 0x0, 0x7ff7bfefee14, 0x7ff7bfefee50, 0x7ff7bfefee92, ...)
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/asm_amd64.s:175 +0x1eb fp=0x7ff7bfefea78 sp=0x7ff7bfefea70 pc=0x105292b
解決策
fzf-binがDeprecatedになっている点にあたりをつけ、下記のようにレポジトリを変更したところ、正しく動作しました。
...
- zplug "junegunn/fzf-bin", \
+ zplug "junegunn/fzf", \
...