簡體   English   中英

為什么在 fish shell 中輸入 $ 會顯示錯誤“Unknown command: bind_dollar”?

[英]Why does typing $ in fish shell show the error "Unknown command: bind_dollar"?

我在 MacOS Monterey 12.5.1 上運行 fishshell 3.5.1 我可以很好地處理大多數命令但是每當我嘗試輸入美元符號時(甚至在按 Return 鍵之前)我都會收到錯誤消息: “未知命令:bind_dollar”

我試過了:

  • 使用 Homebrew 重新安裝
  • 確認魚在 PATH 中
  • 刪除我的 fish.config

以下是我的問題和設置的輸出:

我一輸入美元符號就會發生這種情況:

$ fish: Unknown command: bind_dollar

魚配置目錄:

~/.config/fish
$ ls
completions/    conf.d/         config.fish     fish_variables  functions/

使用 /bin/sh 檢查我的 $PATH:

$ /bin/sh
sh-3.2$ echo $PATH
/usr/local/bin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin

確保魚位於 PATH 中:

sh-3.2$ whereis fish
fish: /usr/local/bin/fish

查看我的 fish.config(默認版本)的內容:

sh-3.2$ cat config.fish
if status is-interactive
    # Commands to run in interactive sessions can go here
end

多虧了 Glenn 的評論,我才得以追查到這個問題:

跑步:

grep -r bind_dollar ~/.config/fish

回來:

~/.config/fish/functions/fish_user_key_bindings.fish

其中包含:

function fish_user_key_bindings
      ### bang-bang ###
      bind ! bind_bang
      bind $ bind_dollar # <-- removing this line fixed the issue
      ### bang-bang ###
  end

刪除“bind_dollar”行解決了這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM