From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28911 invoked by alias); 3 Jun 2016 05:31:44 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21605 Received: (qmail 15158 invoked from network); 3 Jun 2016 05:31:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Date: Fri, 03 Jun 2016 05:31:23 +0000 From: Daniel Shahaf To: zsh-users@zsh.org Subject: X=`cat ~/y` completion Message-ID: <20160603053123.GA26773@fujitsu.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: danielsh-guest@users.alioth.debian.org X-SA-Exim-Scanned: No (on moszumanska.debian.org); SAEximRunCond expanded to false Consider the following two cases: % X=`cat $HOME/t % X=`cat ~/t In 'zsh -f' + compinit, the former works but the latter doesn't. I expect the latter to behave as the former does. --- The last related discussion seems to be 35515/35539. The `functions -t _main_complete` transcripts of the two cases first diverge at _path_files:255, where «$HOME/t» takes the 'if' branch and «~/» the 'else' path: % nl -ba _path_files 253 # Now let's have a closer look at the string to complete. 254 255 if [[ "$pre" = [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* && "$compstate[quote]" != \' ]]; then 256 257 # If there is a parameter expansion in the word from the line, we try 258 # to complete the beast by expanding the prefix and completing anything 259 # after the first slash after the parameter expansion. ⋮ 276 elif [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then 277 278 # It begins with `~', so remember anything before the first slash to be able 279 # to report it to the completion code. Also get an expanded version of it ⋮ 322 else 323 # If the string does not start with a `~' we don't remove a prefix from the 324 # string. ⋮ 353 fi