删除问候语中的Fish shell错误消息

问题描述 投票:0回答:1

我想删除鱼壳问候语。在寻找解决方案时,我去了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个回答
0
投票
您的fish_greeting函数尝试执行一个不存在的名为“ StackOverflow”的命令。使用“ fortune”命令建议原始答案,这可能是您实际安装的东西。

如果同时具有一个函数和一个名为“ fish_greeting”的变量,则该函数优先,因此解决方案是修复该函数。使用现有的命令,或根本不使用任何命令:

function fish_greeting end funcsave fish_greeting

© www.soinside.com 2019 - 2024. All rights reserved.