如何修复错误:每当我在终端中输入内容时都会出现错误

如何修复错误:每当我在终端中输入内容时都会出现错误

我使用 Fish 作为登录终端。我正在尝试运行android模拟器。我已经编辑了 bash 配置文件,因此我通过输入 bash 切换到 bash。注销计算机后,我重新启动了终端,每当我输入任何内容时,都会出现错误。

命令:cd 桌面/

回复:

fish: Unknown command: __fish_pwd
/usr/local/share/fish/functions/fish_title.fish (line 1):
__fish_pwd
^
in command substitution
    called on line 4 of file /usr/local/share/fish/functions/fish_title.fish
in function 'fish_title' with arguments 'cd\ Desktop/'
in command substitution
/usr/local/share/fish/functions/fish_title.fish: Unknown error while evaluating command substitution
in function 'fish_title' with arguments 'cd\ Desktop/'
in command substitution
fish: Unknown command: basename
~/.config/fish/functions/fish_prompt.fish (line 1):
basename (prompt_pwd)
^
in command substitution
    called on line 74 of file ~/.config/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution
~/.config/fish/functions/fish_prompt.fish: Unknown error while evaluating command substitution
in function 'fish_prompt'
in command substitution
fish: Unknown command: __fish_pwd
/usr/local/share/fish/functions/fish_title.fish (line 1):
__fish_pwd
^
in command substitution
    called on line 4 of file /usr/local/share/fish/functions/fish_title.fish
in function 'fish_title'
in command substitution
/usr/local/share/fish/functions/fish_title.fish: Unknown error while evaluating command substitution
in function 'fish_title'
in command substitution

我想返回 Fish 登录 shell,没有错误。任何帮助,将不胜感激。

答案1

由于某种原因,您的fish_title函数无法找到 的函数__fish_pwd。这是一个奇怪的小功能:

$ type __fish_pwd
__fish_pwd is a function with definition
# Defined in /usr/local/Cellar/fish/3.1.2/share/fish/functions/__fish_pwd.fish @ line 7
function __fish_pwd --description 'Show current path'
            pwd
end

您始终可以将其添加到您自己的 ~/.config/fish/functions/ 目录中。

相关内容