
每當我在 ZSH 中輸入嘗試在我的 mac 上使用 nano 開啟檔案時,nano 實際開啟需要大約 4 秒的時間,我不確定為什麼。有沒有人有建議來調試這個問題並找出解決方案?
答案1
所以,由於我沒有得到任何回應,我想我會發布我目前的工作,儘管有點俗氣。
由於該問題似乎僅在我使用 zsh 時發生,因此我在文件末尾添加了以下內容,~/.zshrc
以強制 nano 始終在 bash 而不是 zsh 中打開。
# For some reason, when I open nano in zsh it's incredibly slow
# So instead, alias it with this function that forces nano
# to open in bash instead of zsh.
function nano() {
bash -c "nano $@"
}
雖然這可能不是最好的解決方案,但我不知道發生了什麼或如何解決它。目前,這解決了這個問題。