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
Initial PATH contains /usr/bin/X11 on debian even though it doesn't exist. #199
Comments
Hey songgao I am running Debian Sid and had a similar issue, but not the exact same dir. fish complained about '/usr/X11R6/bin' not existing. Check out share/fish/config.fish If not I have some more digging to do |
Hi Sean-Der, My share/fish/config.fish also has /usr/X11R6/bin set, but not /usr/bin/X11. Also my ~/.config/fish/config.fish doesn't seem to have anything for X11. The weird thing is that, although share/fish/config.fish has /usr/X11R6/bin set in PATH, the actually $PATH has /usr/bin/X11 instead of /usr/X11R6/bin. Just for records, I changed the PREFIX using "./configure" when building fish-shell. |
We probably should pull out the X11R6 by default, that may be in a OSX thing though? I will wait for maxfl or ridiculousfish to comment on this also, BUT it would seem to me a good compromise would |
It seems that, when changing $PATH value, the set command is already designed to check if the directory exists. Try adding a non-exist directory into $PATH, it complains:
In share/fish/config.fish, the entries also seem to be tested before actually inserting into $PATH :
I'm confused... |
Thanks for pointing out that file! I don't know why /usr/X11R6/bin is slipping by the directory test, but I will do my best to mess with that right now and figure it out. I just am finishing up some man pages and I will be ready to check this out real quick |
I'll do you one better: my PATH is being set with a universal variable (which skips the directory checking), and it contains an invalid directory, so even code like |
Fixed with this commit: To git@github.com:fish-shell/fish-shell.git Now fish warns you if you try to set a path containing an invalid directory, but only refuses to set it if every directory is invalid (and there's at least one entry). |
That's awesome. Thanks ridiculousfish! |
I see this has been fixed but I'm experiencing the same as the ticket reporter. Where is /usr/bin/X11 being added to PATH? |
fish does add /usr/X11R6/bin to PATH, in share/config.fish, but /usr/bin/X11 is a mystery. Perhaps it's part of a Universal variable? Do you see it set if you do |
Yep, that's kinda misterious, I recursively run grep on /etc and the fish package contents, whose only 'crypted' files are the man pages (they are gzipped) and I had no match for bin/X11. I guess even the ELF would match the string "X11" but they didn't. There's no X11 in cat '~/.config/fish/fishd.*' either This is happening on a Debian 6.0.6 just installed and then upgraded. How weird. |
Another possibility is that it's coming from the login environment, e.g. .cshrc or .login |
If in /etc then the grep should have matched those, in userdir I've got no .login (and I grepped home dir as well). The default shell in Squeeze is bash so cshrc is unlikely to affect this behavior (and I don't have .cshrc in home). |
@ridiculousfish is there any way to completely disable the warnings when adding non-existing paths? I have use cases where I want paths to be added for a future reference when the path is created. This now works correctly, but seeing those errors every time I add a non-existing path (especially when TDD'ing Fish scripts) can become quite annoying. |
It might be sensible to disable those warnings in non-interactive sessions. |
@ridiculousfish even in interactive sessions I'd like to see a way to silence the output. I have several paths in my PATH that might exist at one point or another, and I'd rather not be warned, as not having the paths exist is not harmful to the functioning of my system, so telling fish not to warn me about non-existing paths in PATH (as I can tell fish not to show a "welcome" message) would cut down the noise in my day-to-day output of Fish. |
fish stopped complaining about invalid path entries (unless they contain a colon) in de8ccf1. |
On a debian "squeeze" base system, a custom compiled fish-shell sets its initial PATH to contain /usr/bin/X11, which does not exist in the system. This prevents "set" command from appending more entries into PATH variable because it will look for each entry in the provided PATH list, including the ones already in PATH, but "/usr/bin/X11" does not exist.
"mkdir /usr/bin/X11" makes it work.
Could this be a bug? Probably somewhere for looking up X11 path.
The text was updated successfully, but these errors were encountered: