The export.fish script exits with an exit code of 4. Thus, any shell checks that make sure the source command exits successfully always failed. This was due to the last line trying to erase the __main function. In fish, you can't erase a function using the `set` command, you can only erase variables. By removing that line the script now exits with an exit code of 0 instead of 4.
Erase __main function at the end of export.fish
Closes https://github.com/espressif/esp-idf/pull/10828
This prevents starting a new shell with the IDF environment like this:
env IDF_PATH=/my/idf/path fish -C 'source "$IDF_PATH"/export.fish'
as `status current-command` returns `fish` in this case, but this check expects
`source`.
This check does nothing anyway, as you can't even execute that file even if it
was marked executable, as fish rejects files without a shebang, and it's not
valid bash.
Closes https://github.com/espressif/esp-idf/pull/5860