Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Global alias mangles input in 5.0.8



I'm running on x86-64 Arch Linux, and noticing what looks like a bug doing the following:



> alias -g '$'='4<<('

> cat /proc/self/fd/4 $ ls )


The behavior of setting and using an alias like this in zsh 5.0.7 is relatively sane: the result of ls is piped through cat.



But under zsh 5.0.8, I get an error: "zsh: no such file or directory: s )".


I really don't understand why the first letter of "ls" is being removed or why the space and the closing paren are considered part of the same token as the 's'.


To further confuse matters, the precise filename in the error depends on how long the expansion of the alias is. If I add a space, and set it to '4 <<(' (or, to identical effect, put the space in front of the 4 instead of after), the file not found is " )" (without the 's'). Another space and the file is just ")", and with three spaces zsh is failing to find a file named the empty string.


Beyond three spaces I get "zsh: unterminated `<(...)'", which is surprising since the right paren is fairly clearly visible in the line to alias-expand.


For what it's worth, I see the same behavior with a non-special token being aliased, such as 'x' instead of '$'.


Thanks for your time.


Messages sorted by: Reverse Date, Date, Thread, Author