zsh-workers
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Zsh Workers <zsh-workers@zsh.org>
Subject: Expansion bug with braces and spaces
Date: Thu, 7 Apr 2011 14:44:17 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.01.1104071433150.28316@hp> (raw)

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


             reply	other threads:[~2011-04-07 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 18:44 Benjamin R. Haskell [this message]
2011-04-07 18:59 ` Mikael Magnusson
2011-04-08  8:44   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1104071433150.28316@hp \
    --to=zsh@benizi.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).