After updating a bunch of utilities via brew, I upgraded fish shell
from something close to 3.0 to 3.3.1. Now there's a series of so-far harmless, but highly distracting error messages appearing every time I hit return
in Terminal.
$ ls
README.md node_modules package.json static tsconfig.json
mdsvex.config.cjs package-lock.json src svelte.config.js work.eqg
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$ echo Hi 👋🤓
Hi 👋🤓
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$
fatal: ambiguous argument '^/dev/null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: bad revision '^/dev/null'
fatal: Refusing to point HEAD outside of refs/
fatal: No names found, cannot describe anything.
head: ^/dev/null: No such file or directory
$
Note: I've simplified my prompt to just $
because a lot of it doesn't copy/paste well. Fwiw, I'm using Bob the Fish, & here's a screenshot:
Anyway…any ideas for how to troubleshoot this?
fish-shell/fish-shell
issue 8105 mentions:
If you encounter these errors in prompt after updating fish shell to 3.3.0:
fatal: not a git repository (or any of the parent directories): .git fatal: Refusing to point HEAD outside of refs/
Then probably you have error redirection with caret (
^
) in your prompt. Replace it with2>
.
It suggests:
Doing a full
grep -r '\^[/&]' ~/.config/fish/
and fixing everything that comes up (that isn't already quoted)
For example:
I ran that command and found the culprit, it was https://github.com/sjl/z-fish.