From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13170 invoked by alias); 14 Aug 2015 08:53:58 -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: 36166 Received: (qmail 15087 invoked from network); 14 Aug 2015 08:53:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=3iPe3J3mrkryM+ux3swBAZsNQija/sUJv/QJfrd27vQ=; b=eJSiMwzfUOu2qRUjyIKFVwZMwXozYAGbzNTYd5+ppqW19I9uk6iiWweKvUjny/MC7N gGqECYQfoeXq5h4BYRhwssv+yHiWWCaPSoFgVXPHrt5KzhDQCH0qS4/PfcY9VivqzqDA N+ZCpTTMU9ygQWgqj+P7CoUkf3J1exUUu6ZlSsEGzIUgsNTsfv/CqNeP6/xCq7uQ5z5w 0UUGlzVEgFaia04QkU0IZFj1gm1fGpgTXmnJPTyvLdatssc2APvCUobYE/sxr4p7BKxJ IkDDG1P7qYXjriyLinewOMk94L7LrZGzp5CucGXddEdQ2DIjNYZ5RExj0BnDc2xWuhM1 9flQ== X-Received: by 10.112.87.69 with SMTP id v5mr24382567lbz.12.1439542434526; Fri, 14 Aug 2015 01:53:54 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Fri, 14 Aug 2015 10:53:35 +0200 Message-ID: Subject: Repeatable (@M) bug To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary=001a113436fe72fd68051d4197e1 --001a113436fe72fd68051d4197e1 Content-Type: text/plain; charset=UTF-8 Hello Summary description: searching for "xyza" doesn't match "xyza", only "xyzab" Illustration by code: --------- list=( "aisj" ) echo "1 |${(@M)list:#*aisj*}" list=( "aisj" "aisja" ) echo "2 |${(@M)list:#*aisja*}" echo "3 |${(@M)list:#*aisj*}" list=( "aisj" "aisja" "aisjas" ) echo "4 |${(@M)list:#*aisjas*}" echo "5 |${(@M)list:#*aisja*}" echo "6 |${(@M)list:#*aisj*}" --------- This example works. "aisj" returns "aisj", "aisja" returns "aisja", "aisj" returns "aisja" AND "aisj", etc. However in a script the same steps yield the erroneous behavior: "aisj" matches only "aisja" and "aisjas", and "aisja" matches only "aisjas". The script is: https://github.com/psprint/zsh-visual-tools/ It is really simple. It allows to grep for a pattern when displaying history. Calling the script extends history content - like the 'list=( "aisj" "aisja" )' lines. Equivalent of the code already mentioned is: v-list aisj No matching history entries v-list aisja No matching history entries v-list aisj (matches only aisja) v-history aisjas No matching history entries v-history aisja (matches only aisjas) v-history aisj (matches only aisja and aisjas) Also, when I wrote a script to repeat v-history calls automatically (no through command line) it resulted in: v-history:fc:21: no such event: 1000 This is a very interesting result, as the `history -rn 1000` call just must work. I checked this on OSX 5.0.2 and hombrew's 5.0.8-dev-1. PS. What I mean by the last mentioned script is: #!/bin/zsh autoload v-history v-history aisj v-history aisja v-history aisj v-history aisjas v-history aisja v-history aisj Best Regards, Sebastian --001a113436fe72fd68051d4197e1--