-
Notifications
You must be signed in to change notification settings - Fork 21
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
[Bug report] superuser detection brittleness #166
Comments
Thanks for the report, and for looking through the -xv output. I can't replicate the error: starting from a non-privileged user, I get % exec zsh -xv
# snip
+/[snip]/zsh-abbr.zsh:86> [[ % == \# ]]
# no "parse error"
# snip And the suggested change breaks support for distinct tempdirs for privileged and unprivileged users.
// This makes me realize it'd be good to add a config var for the privileged user tmpdir - ${${ABBR_TMPDIR:-${${TMPDIR:-/tmp}%/}/zsh-abbr-privileged-users}%/}/
+ ${${${ABBR_TMPDIR_PRIVILEGED_USERS:-ABBR_TMPDIR}:-${${TMPDIR:-/tmp}%/}/zsh-abbr-privileged-users}%/}/ // This will take some more investigation.
|
Thank you for the swift reply and for the wonderful piece of code that zsh-abbr is. I got an What tipped me off that something went wrong was the red zsh prompt right after login. I have a very minimalistic .zshrc:
I immediately |
I've pushed up a fix attempt in the new branch |
running
|
Thanks! Bummer. Might be a week and a half minimum before I have zsh-abbr time again. But we'll figure this out eventually… |
Is there an existing issue for this?
Update the issue title
Expected Behavior
zsh-abbr loads normally
Actual Behavior
zsh-abbr fails silently
Steps To Reproduce
running
exec zsh -xv
revealszsh:86: parse error near `#'
line 86 reads:
86 if [[ ${(%):-%#} == '#' ]]; then
trying to escape the # character with a backslash \ works in some contexts in Zsh, however within the [[ ... ]] conditional expression and especially in combination with the parameter expansion flags, is causing a parse error. Zsh is misinterpreting # in this context.
Environment
Installation method
Manual
Installation method details
~ # echo $ABBR_SOURCE_PATH
/opt/zsh-abbr
Anything else?
replacing line 86 with
86 if [[ "%#" == '#' ]]; then
makes it work again
The text was updated successfully, but these errors were encountered: