From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10476 invoked by alias); 31 Aug 2014 20:50:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33079 Received: (qmail 12771 invoked from network); 31 Aug 2014 20:50:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140831135017.ZM739@torch.brasslantern.com> Date: Sun, 31 Aug 2014 13:50:17 -0700 In-reply-to: Comments: In reply to Jonathan H "Re: _expand_alias does not expand aliases that contain an "!"" (Aug 30, 7:58pm) References: <140830133206.ZM13172@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Jonathan H Subject: Re: _expand_alias does not expand aliases that contain an "!" Cc: zsh-workers@zsh.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 30, 7:58pm, Jonathan H wrote: } } Oddly enough, for me _expand_alias works for all characters in } [*#?@:+-^%$.,]. the only character that didn't work and wasn't already } meaningful to the shell was the exclamation point. Hmm. Indeed, something is treating "!" as additionally special. The interesting part is that it does not always treat the first character of the $HISTCHARS variable as special, nor does it treat ! as special when it is not the first character of $HISTCHARS. Or (more likely) internally somewhere is explicitly un-quoting file expansion characters but is not doing so for history characters. This could probably be fixed but might take a while to trace down. } I'm on Zsh 5.02, Ubuntu 14.04 x64 and Fedora Rawhide x64. One possible } solution on my end is to define the aliases like this: } } Heptagon% alias 'gc!'="git commit --amend" } Heptagon% alias 'gc\!'="git commit --amend" Sure, that's fine as long as you never want to be able to type gc\! to prevent the first alias from expanding. Or the patch I sent should apply to _expand_alias in 5.0.2.