zsh を 5.6.2 にバージョンアップ後、tmux セッション内でエラーが発生。
そのため、zsh をダウングレードして解決。

解決するまでなかなか困ったので、備忘録を兼ねて書いておきます。

ちなみに
tmux のバージョンは 2.7
zplug のバージョンは 2.4.0
です。

エラー内容

zsh 起動時に zplug で以下のエラーが発生。
(zplug までの PATH は...に置換してます。)
(google-cloud-sdk などでもエラーが発生していたが割愛。)

.../zplug/autoload/init.zsh:16: colors: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::prepare:66: compinit: function definition file not found
__zplug::io::print::f:56: bad math expression: illegal character: ^[
[zplug] Loaded from cache (.../zplug/cache)
__zplug::core::load::from_cache:12: no such file or directory: .../zplug/cache/fpath.zsh
__zplug::core::load::from_cache:source:17: no such file or directory: .../zplug/cache/plugin.zsh
__zplug::core::load::from_cache:source:18: no such file or directory: .../zplug/cache/lazy_plugin.zsh
__zplug::core::load::from_cache:source:19: no such file or directory: .../zplug/cache/theme.zsh
__zplug::core::load::from_cache:source:20: no such file or directory: .../zplug/cache/command.zsh
__zplug::core::load::from_cache:source:23: no such file or directory: .../zplug/cache/defer_1_plugin.zsh
__zplug::core::load::from_cache:24: compinit: function definition file not found
[zplug] Run compinit
__zplug::core::load::from_cache:source:29: no such file or directory: .../zplug/cache/defer_2_plugin.zsh
__zplug::core::load::from_cache:source:30: no such file or directory: .../zplug/cache/defer_3_plugin.zsh

原因と解決策

zplug で issue が開いています。(2018-09-20 14:30:00 時点)
https://github.com/zplug/zplug/issues/477

zsh のバージョンアップ後にエラーが出たのと、google-cloud-sdk 等でもエラーが出てたので、zplug ではなく、zsh 自体が問題っぽい。

そのため、zsh のバージョンを 5.5 に戻し、解決しました。

手順

# zshのFormulaファイルがあるフォルダへ移動
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

# zshのFormulaファイルのログを見て、戻したいバージョンが記されているコミットIDを探す
git log zsh.rb

# zshのFormulaファイルを巻き戻す
# 今回は5.5.1に戻すので、3232544b5f6f0d2b65c6ed89622beb11c4643bが該当のコミットID
git checkout 6d3232544b5f6f0d2b65c6ed89622beb11c4643b zsh.rb

# zshを再インストールする
brew reinstall zsh

# バージョン確認
zsh --version

# Formulaファイルを元に戻す
git checkout zsh.rb

参考

https://qiita.com/honeniq/items/778cc08d2db78e6774d8