Evals need escaping #152

Closed
danielshahaf opened this Issue Apr 22, 2016 · 2 comments

2 participants

@danielshahaf

https://github.com/zsh-users/zsh-autosuggestions/blob/87facd9b85630f288433aa0a20a963cffc612ee5/zsh-autosuggestions.zsh#L134 needs to escape $widget as ${(q)widget} because the value $widget might be shell-unsafe. (E.g., the plugin "opp.zsh" creates widgets with literal ( in their names, according to a bug report (issue 278) I received over at z-sy-h, which would cause the eval to report a syntax error.)

@ericfreese
zsh-users member

Working on adding the q flags. Seems to fix the errors associated with opp.zsh.

I'm curious... What was the reason behind the change from

${${widgets[$cur_widget]#*:}/:/ }

to

${${(s.:.)widgets[$cur_widget]}[2,3]}

in zsh-users/zsh-syntax-highlighting@11d3783 and zsh-users/zsh-syntax-highlighting@cb02451?

@danielshahaf

Forward compatibility in case more colon-separated fields are added at the end in the future.

But you should review the combined diff 4849ef3..cb02451; most of the interim commits were stupid mistakes and their corrections.

@ericfreese ericfreese added a commit that referenced this issue Apr 25, 2016
@ericfreese ericfreese Fix #152 by escaping widget names inside evals
Solves problems when dealing with widget names with irregular
characters such as those that come from `opp.zsh`.
a8305ac
@ericfreese ericfreese added a commit that referenced this issue Apr 25, 2016
@ericfreese ericfreese Use array indices for forward compatibility
See issue #152
1c0f826
@ericfreese ericfreese added a commit that referenced this issue Apr 25, 2016
@ericfreese ericfreese Use array indices for forward compatibility
See issue #152
964773a
@Eriner Eriner referenced this issue in Eriner/zim May 14, 2016
Open

Add zsh-autosuggestions module #35

@ericfreese ericfreese added a commit that closed this issue May 28, 2016
@ericfreese ericfreese Fix #152 by escaping widget names inside evals
Solves problems when dealing with widget names with irregular
characters such as those that come from `opp.zsh`.
945c660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment