【问题标题】:Fish Unknown command: __fish_pwd鱼未知命令:__fish_pwd
【发布时间】:2021-04-18 15:11:26
【问题描述】:

在fish中运行任何命令时,我收到以下错误:

fish: Unknown command: __fish_pwd
/opt/homebrew/Cellar/fish/3.2.2/share/fish/functions/fish_title.fish (line 1): 
__fish_pwd
^
in command substitution
        called on line 6 of file /opt/homebrew/Cellar/fish/3.2.2/share/fish/functions/fish_title.fish
in function 'fish_title' with arguments 'echo\ \$PATH'
in command substitution
/opt/homebrew/Cellar/fish/3.2.2/share/fish/functions/fish_title.fish (line 6): Unknown error while evaluating command substitution
        echo (set -q argv[1] && echo $argv[1] || status current-command) (__fish_pwd)
                                                                         ^

不确定如何解决这个问题。我试过卸载/重新安装fish。

我见过的其他解决方案 (fish: Unknown command '__fish_pwd') 建议删除 config.fish,但除了我的 PATH 之外,我的中没有任何内容。

我的$PATH 看起来像这样:

/sbin /opt/homebrew/bin /opt/homebrew/sbin /Users/[username]/usr/bin /bin /Users/[username]/bin /Users/[username]/sbin /sbin

【问题讨论】:

  • 文件/opt/homebrew/Cellar/fish/3.2.2/share/fish/functions/__fish_pwd.fish是否存在? (它应该)。 echo $fish_function_path 显示什么?
  • @ridiculous_fish 是的,该文件确实存在。这是echo $fish_function_path 返回的内容:gist.github.com/tbhockey/a5f6e82070ffdf0d11475ffc8fe3ed48
  • uname 说什么?

标签: macos homebrew fish apple-m1


【解决方案1】:

您的 $PATH 似乎已损坏,因为它不包含 uname

它可能在 /usr/bin 或 /usr/sbin 中(“/usr”不是 /Users),而您错过了。

(fish 在这里使用uname 来确定你是否在 Cygwin 上,在这种情况下,它会改变它在标题中打印的 $PWD。这当然非常俗气,错误消息是“未知错误”,应该改进。无论如何,你的 $PATH 不完整,所以你应该修复它)

但是除了我的 PATH 之外,我的里面什么都没有。

请尝试删除它并重新启动您的所有钓鱼会话。这很可能会解决问题。

【讨论】:

  • 谢谢!我想就是这样!我将其中许多路径设置为$HOME/usr/bin/..,而它们本来应该是/usr/bin...。现在似乎一切正常
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-08-03
  • 1970-01-01
  • 2014-04-27
  • 2014-03-08
  • 1970-01-01
  • 1970-01-01
  • 2023-02-03
相关资源
最近更新 更多