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
Escape special characters #72
Conversation
lgtm, but I think it's weird that only _z_add uses perl, while the main z script still uses awk. Preferably one of these dependencies would be removed. |
actually I realized this doesn't fix the real issue, because that one is in Basically |
Are you referring to #53 ? I recall that the issue was with how awk passed back the path (in single quotes), and has no relation to the use of regex. If you can think of a way to get around it by removing the use of regex, I'm fine with it, but otherwise it's not solving the issue either. I'm actually not on fish right now, because fish 3.0 uses 100% of my CPU and completely breaks down, but I'll test it properly once you think you have a fix. |
awk treats variables like string literals; so a backslash will be interpreted as the start of an escape sequence. Escape backslashes to avoid this.
Yes, I figured out how to fix it. If we pass a string to awk, then backslashes need to be escaped. Additionally strings that are used as regex must be escaped. I'm using
Well that's strange. :( Did you try disabling all plugins and configuration? |
The query is used as regex, so special pattern characters need to be escaped; fish builtin "string escape --style=regex" seems to work perfectly. Also escape backslashes to avoid interpretation as escape sequences.
Nice! Thanks for all the effort so far, I can see the considerable amount of work you've put in here.
Cool, the workaround seems relatively simple, although all this string-escaping stuff seems to be adding some complexity. I'd been completely fine if this was only fixed for 3.0 and above
Some people are facing the same issue fish-shell/fish-shell#5528, and I don't really use my shell much these days: lots of stuff I used to do I now do in Emacs.
Happy to add you as co-maintainer if you're up for it. This feels like done software, and there's few issue reports, so it should be relatively low effort. |
The support for fish prior to 3.0 adds just that one function (
That looks nasty :(
Same here actually but I still heavily depend on my shell.
Sounds great, thanks! |
Co-Authored-By: krobelus <aclopte@gmail.com>
yeah I was thinking that if it were any more complicated than that, I'd be fine with it, since it's not particularly deal-breaking, and I try to avoid making the code too complex.
Done! |
I understand the data file is sorted by the path name. Not that it matters but
this preserves this behavior.