Skip to content

[Bug report] superuser detection brittleness #166

Description

@crgr

Is there an existing issue for this?

  • I have searched the existing issues

Update the issue title

  • I have updated the title

Expected Behavior

zsh-abbr loads normally

Actual Behavior

zsh-abbr fails silently

Steps To Reproduce

running exec zsh -xv reveals

  • zsh:86> [[ '' == \ # ]]
    zsh: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

~ # abbr profile
zsh-abbr version 6.2.1
zsh 5.9 (x86_64-debian-linux-gnu)
OSTYPE linux-gnu

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions