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

Re: Expansion bug with braces and spaces



On 7 April 2011 20:44, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> There seems to be some issue with expansion of brace alternatives when
> there's a space in the filename.  First noticed when I had a bunch of poorly
> named downloads:
>
> $ ls -1 Download/bug\ \(*
> Download/bug (1).patch
> Download/bug (2).patch
> ...etc...
> Download/bug (17).patch
> Download/bug (18).patch
>
> And I wanted to see the differences between two of them:
> $ diff -ur Download/bug\ \({1<Tab>
> $ diff -ur Download/bug\ {\(1
>
> (hitting tab again made it worse)
> $ diff -ur Download/bug\ {\(1<Tab>
> $ diff -ur Download/bug\{ \(1
>
> (but not again, since the file no longer exists)
> $ diff -ur Download/bug\{ \(1<Tab>
>
>
> A more minimal example:
>
> $ bindkey "^I" expand-or-complete
>
> $ mkdir /tmp/brace-bug
> $ touch /tmp/brace-bug/file\ {abcd,abce}
>
> # this one's weird, but still okay:
> $ print -l /tmp/brace-bug/file\ ab{<Tab>
> $ print -l /tmp/brace-bug/file\ a{bc
>
> # this one's not okay, since it's now quoting the brace:
> $ print -l /tmp/brace-bug/file\ {a<Tab>
> $ print -l /tmp/brace-bug/file\{ abc

It's at least not a new issue, I reported it back in 2006 but was
never able to produce a minimal testcase starting from zsh -f. And by
able I mean it never annoyed me enough :).

-- 
Mikael Magnusson



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