sorin-ionescu / prezto

The configuration framework for Zsh
MIT License
13.98k stars 4.49k forks source link

Issues with "#" character #1952

Closed polygon closed 3 years ago

polygon commented 3 years ago

Description

Sorry if this has been asked before, but searching for this issue seems to be very inconvenient.

Anyways, after installing prezto I have issues with commands containing the "#" character. I am using Nix and I often have to type things like:

nix shell nixpkgs#python

After I have installed prezto, the above line suddenly nets me the error:

zsh: no matches found: nixpkgs#python

I now have to escape that character like so but this is hugely inconvenient:

nix shell nixpkgs\#python

I've found this issue from where I got the hint that this might be related to prezto:

https://github.com/mroth/scmpuff/issues/17

The above commands do work if I disable prezto. I am wondering what prezto does to the "#" character and if I can disable this behavior.

Expected behavior

The command should work without escaping the "#" character

Actual behavior

The command fails unless I escape the "#" character

Steps to Reproduce

  1. Install and enable prezto
  2. Run a command that contains a "#"
  3. Command will no longer work
polygon commented 3 years ago

After some more digging, this seems to be related to EXTENDED_GLOB. If I run

unsetopt EXTENDED_GLOB

in a shell, the commands start working again. Does prezto require that option to be set or is it safe to disable it. If so, how? I could always add the unset command manually to .zshrc, but that seems not very clean.

polygon commented 3 years ago

I seem to be able to sidestep this by adding unsetopt NOMATCHto my zsh initialization. So I'll be closing this as it seems fixed.