Some items are not working after fish 4.0 update
I have noticed the items that rely on check if specific files are in the current tree are not working. (for example rust and node). Basically the path is $_tide_parent_dirs is not working correctly.
Debugging it, I've noticed the path is is fine, so I believe the generation of the env variable is not being done correctly. We're getting a '' entry in there.
Maybe something like this:
string escape (
for dir in (string split / -- $PWD)
if test (string length $dir) -lt 1
continue
end
set -a parts $dir
string join / "" $parts
end
)
The above adds a test so we dont get any '' dirs, and then ensure we prepend each string with a / by adding that empty string at "". I dont think you would want to use trim or others due to dirs with spaces in them '/foo/bar/baz pancakes/'. This keeps them wrapped in single quotes.
string escape (
for dir in (string split / -- $PWD)
+ if test (string length $dir) -lt 1
+ continue
+ end
- set -la parts $dir
+ set -a parts $dir
- string join / -- $parts
+ string join / "" $parts
end
+ # unsure if this is needed
+ set --erase $parts
)
I dont know much really about fish as a language, but thought I'd contribute to the conversation.
UPDATE: ~~this looks great on paper but fails make test. someone will need to safely quote the dirs.~~ I did! See the linked PR in #566 🚀
I took a stab at this in https://github.com/IlanCosman/tide/pull/566