Skip to content

[Bug report] Abbreviation expansion not working for escaped characters #182

@JoanChirinos

Description

@JoanChirinos

Is there an existing issue for this?

  • I have searched the existing issues

Update the issue title

  • I have updated the title

Expected Behavior

I have a ZSH alias that I tried to make into an abbreviation with abbr import-aliases. The expected behavior is for it to expand properly. I'm censoring the first command for work purposes, but I don't think that changes anything.

The alias is

$ which gstatus
gstatus: aliased to censored-command -all -cnt "echo -e \"\n\033[1;34mPackage: \$(basename \$(pwd))\033[0m\" && git status -s"

To be more specific, I should be able to expand my command gstatus to censored-command -all -cnt "echo -e \"\n\033[1;34mPackage: \$(basename \$(pwd))\033[0m\" && git status -s"

Actual Behavior

The command gstatus currently doesn't expand properly, making it impossible to use unless I delete the abbreviation and keep it a simple alias.

$ which gstatus
gstatus: aliased to censored-command -all -cnt "echo -e \"\n\033[1;34mPackage: \$(basename \$(pwd))\033[0m\" && git status -s"

$ "censored-command -all -cnt ^[cho -e \

Here, gstatus is expanding to "censored-command -all -cnt ^[cho -e \, which is quite broken.

Steps To Reproduce

  1. Have an alias alias gstatus='censored-command -all -cnt "echo -e \"\n\033[1;34mPackage: \$(basename \$(pwd))\033[0m\" && git status -s"'
  2. Import the alias as an abbreviation: abbr import-aliases
  3. Try to expand the abbreviation: $ gstatus <space> -> $ "censored-command -all -cnt ^[cho -e \

Environment

zsh-abbr version 6.3.0
zsh 5.9 (x86_64-pc-linux-gnu)
OSTYPE linux-gnu

Installation method

Manual

Installation method details

Just installed it like normal: got a release and threw this into my .zshrc

source /home/joanchir/zsh-abbr/zsh-abbr.zsh

Anything else?

I'm only pretty sure there isn't an existing issue for this; there's another about some kind of escape character bug, but I don't think it's the same?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions