Skip to content
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

Some items are not working after fish 4.0 update #564

Open
augustocdias opened this issue Mar 3, 2025 · 2 comments · May be fixed by #566
Open

Some items are not working after fish 4.0 update #564

augustocdias opened this issue Mar 3, 2025 · 2 comments · May be fixed by #566
Labels
🐛 bug Something isn't working

Comments

@augustocdias
Copy link

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.

@augustocdias augustocdias added the 🐛 bug Something isn't working label Mar 3, 2025
@nnungest
Copy link

nnungest commented Mar 5, 2025

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.

@nnungest nnungest linked a pull request Mar 6, 2025 that will close this issue
4 tasks
@nnungest
Copy link

nnungest commented Mar 6, 2025

I took a stab at this in #566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants