【问题标题】:Remove Fish shell error message in greetings删除问候语中的 Fish shell 错误消息
【发布时间】:2020-05-11 07:54:19
【问题描述】:

我想删除鱼壳问候语。当我在寻找解决方案时,我去了this StackOverflow question,看到了一种可以将默认欢迎脚本最小化为新脚本的技术。我在我的终端上做了这个:

pranav@exam ~> function fish_greeting
                   StackOverflow
               end
pranav@exam ~> funcsave fish_greeting

这是被接受且被高度评价的答案。我想知道为什么它对我不起作用。因为再次启动终端会在用户输入上方显示这个大混乱:

~/.config/fish/functions/fish_greeting.fish (line 2): 
StackOverflow
^
in function 'fish_greeting'
    called on line 126 of file /usr/share/fish/functions/__fish_config_interactive.fish
in function '__fish_config_interactive'
    called on line 170 of file /usr/share/fish/config.fish
in function '__fish_on_interactive'
in event handler: handler for generic event “fish_prompt”
pranav@exam ~> 

所以当我找到this command in the FAQ page of Fish时,我想完全删除它的问候:

pranav@exam ~> set fish_greeting

现在,问题是这不起作用。我重新启动了终端,停止了 GDM,并重新启动了 GDM,因为我使用了 Wayland 显示服务器,尝试注销和登录,甚至重新启动了我的计算机,但没有一个工作。因为每当我启动终端时,我仍然可以看到错误消息。我使用 Ubuntu 20.04 和 pranav@exam ~>。如果你是鱼壳专家,请帮助刚刚开始使用这个神奇贝壳的菜鸟学生。

【问题讨论】:

    标签: ubuntu config gnome fish gnome-terminal


    【解决方案1】:

    您的 fish_greeting 函数尝试执行一个名为“StackOverflow”但不存在的命令。最初的答案建议使用“fortune”命令,这是您可能已经安装的实际东西。

    如果你有一个函数和一个名为“fish_greeting”的变量,函数优先,所以解决方法是修复函数​​。使用存在的命令,或者根本不使用:

    function fish_greeting
    end
    
    funcsave fish_greeting
    

    【讨论】:

    • 非常感谢。我犯了一个愚蠢的错误。它浪费了我的几个小时。希望这个问题能帮助像我这样的其他人。 :-D
    猜你喜欢
    • 1970-01-01
    • 2012-08-19
    • 2021-10-28
    • 2019-02-03
    • 1970-01-01
    • 2021-01-28
    • 1970-01-01
    • 1970-01-01
    • 2021-09-19
    相关资源
    最近更新 更多