Skip to content

Fish silently accepts broken source commands and silently breaks non related software. #10774

@onnimonni

Description

@onnimonni

Hey,

I found one of the weirdest bugs recently where totally non fish related program (nix copy) hangs indefinetely when I had a broken config in my ~/.config/fish/config.fish.

You can reproduce this by adding broken source command into your config:

$ echo -e '\nsource $NON_EXISTING_VARIABLE/non-existing-config.fish' >> ~/.config/fish/config.fish
$ fish

I had been accidentally refactoring my fish config and didn't notice this issue for years. I only learned about this after I started using nix.

This was rather frustrating to debug and find.

Is there a way where I could automatically throw an error or at least output something to stderr when the target file of the source command fails?

Software versions and config

$ fish --version
fish, version 3.7.1
$ echo $version
3.7.1
$ uname -a
Darwin $MY_MACHINE.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 arm64
$ echo $TERM
xterm-256color

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions