zsh-workers
 help / color / mirror / code / Atom feed
* Expansion bug with braces and spaces
@ 2011-04-07 18:44 Benjamin R. Haskell
  2011-04-07 18:59 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin R. Haskell @ 2011-04-07 18:44 UTC (permalink / raw)
  To: Zsh Workers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-08  8:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07 18:44 Expansion bug with braces and spaces Benjamin R. Haskell
2011-04-07 18:59 ` Mikael Magnusson
2011-04-08  8:44   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).