Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Expansion bug with braces and spaces
- X-seq: zsh-workers 28978
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxx>
- Subject: Expansion bug with braces and spaces
- Date: Thu, 7 Apr 2011 14:44:17 -0400 (EDT)
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author