From the fish manual:
[The File Descripter may be] an ampersand followed by a minus sign (&-). The file descriptor will be closed
From the Arch wiki:.
Silencing standard output: $ command > &-
From this I expected it to act like an alias for
/dev/null, but quick experimentation on the command line reveals that this is not so:
$ echo hello >&- Error while writing to stdout write_loop: Bad file descriptor
Also, oddly if we add a space before the & we get a a different error:
$ echo hello > &- Expected a string, but instead found a '&'
What on earth is going on here? I'm running fish 2.2.0