New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right prompt prints "Permission Denied" errors to fish stderr. #9975
Comments
fish does not ship with a default |
Oh, I see. I admit one of the first things I did was select a color theme via fish_config. |
Maybe this helps: My version of the file is missing the first 23 lines. |
Okay, run this: function fish_right_prompt; end That should remove the errors from the prompt. Now, run this: command git status --porcelain That should give you "permission denied" errors - it's the only git call in scales that doesn't have its stderr silenced, and I don't see anything else that would print that error. The reason for them is that you have git directory above your current directory, that git finds, but it's inaccessible to git. That seems like a weird setup. Nevertheless, we can silence that git call as well.
Note: It doesn't happen when running git rev-parse in bash because it doesn't happen for git rev-parse. The shell has very little to do with that. |
Thanks for the fix! ❤️ Sorry for misattributing the print, guess I need to up my strace game. |
System info
The default
fish_right_prompt
usesgit rev-parse --git-dir 2>/dev/null
to determine if it is inside a git repository.That causes git (or at least version 2.41.0) to check all directories that are
.gitignored
for a file called.gitkeep
.If this .gitignored folder is not readable for the current user, fish prints:
path/to/ignored_dir/.gitkeep: Permission denied
to its own stderr. Sincefish_right_prompt
gets run anytime I run any command, I get this error anytime I do anything in an affected git repository. This does not occur when running thegit rev-parse
command in bash.And it is definitely fish printing this message! If i redirect fish's stderr to /dev/null, I do not get the output:
I am also confident that
fish_right_prompt
is causing the access to the.gitkeep
files, because disabling it also makes the messages go away:You might be wondering why I have a gitignored directory that my user may not read from:
It is used as a volume for a docker container running postgres, the container runs with a different uid and sets the permissions of the directory.
The text was updated successfully, but these errors were encountered: