Doesn't play nice with ~ when extended_glob enabled #168

Open
psprint opened this Issue Jun 9, 2016 · 12 comments

3 participants

@psprint

Hello,
when entering a path with "~" on the beginning, then autosuggestions will keep appending text without reason:

Video:
https://asciinema.org/a/b6qo4v7o3ekvl3yw6wit0vfsa

@ericfreese
zsh-users member

Thanks for this. I'm not able to reproduce. Can you reproduce running zsh -f and manually sourcing z-asug?

@psprint

Not able to reproduce. Works without colors:

https://asciinema.org/a/1d5hrip5gau6hjju4rkmjhntq

@ericfreese
zsh-users member
ericfreese commented Jun 9, 2016 edited

Ok, so it sounds like there's some compatibility issue with something else you're doing in your .zshrc. Not much I can do until we figure out what's causing the issue.

Can you work through your .zshrc and try to determine which settings are causing this issue?

@ericfreese
zsh-users member

#130 may be related.

@psprint

I worked through whole .zshrc and .zshenv (had the option set there in first place), it turned out the reason is setopt extended_glob. If I have this in .zshenv or .zshrc then there is problem.

@ericfreese
zsh-users member

Great, thanks for digging into this!

I'm actually seeing a slightly different behavior than your original asciinema. In the session below, I'm seeing no suggestion after typing cd ~, when I should be getting an appended suggestion of /Code. I've tried both zsh 5.0.8 and 5.2.

asciicast

Do you get the same behavior as above? Or are you still seeing extra incorrect text appended?

There's definitely a bug here. Just want to make sure we're on the same page.

@ericfreese ericfreese added the bug label Jun 9, 2016
@psprint
psprint commented Jun 9, 2016 edited

Yes the same behavior when with zsh -f

You're welcome!

@ericfreese ericfreese changed the title from Doesn't play nice with ~ to Doesn't play nice with ~ when extended_glob enabled Jun 10, 2016
@ericfreese
zsh-users member

@psprint Should be fixed on the fixes/tilde_extended_glob branch. Mind trying it out and confirming for me?

@psprint

Confirmed, with the branch I can type ~ normally 👍

@ericfreese
zsh-users member

🍻 Cheers, thanks!

@psprint

You're welcome :)

@ericfreese ericfreese referenced this issue Jun 10, 2016
Open

v0.3.3 #169

5 of 9 tasks complete
@arianf

@ericfreese As I mentioned in my original issue #130, there are multiple characters that cause an issue, not just ~.

When you changed the regex below from old to new, it introduced odd behavior. You fixed some with fixes/tilde_extended_glob, but not everything has been fixed.

"${1//(#m)[\\()\[\]|*?]/\\$MATCH}" #new 
"${1//(#m)[\][()|\\*?#<>~^]/\\$MATCH}" #old

"${1//(#m)[\\()\[\]|*?~]/\\$MATCH}" # fixes/tilde_extended_glob

The following characters also causes weird behavior...

^
#

Check out this video to show how the odd behavior is: https://vid.me/nOLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment