From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23817 invoked by alias); 5 Oct 2017 19:56:41 -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: 41816 Received: (qmail 10437 invoked by uid 1010); 5 Oct 2017 19:56:41 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f182.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.182):SA:0(-4.2/5.0):. Processed in 2.734304 secs); 05 Oct 2017 19:56:41 -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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_SORBS_SPAM,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=ZZlz11YIUzE6r/D19TktKWKcegkjhIT0PYr0FgYcjvM=; b=FuPOXKEn6qOFBS7BH1IFlaa8ZyP1D4CXrOM5jwrzhvOxuCEJ8h22r914MDrS88rXr5 ZMFxED1o13/P2bPetRzIqkXF4oeWFSAfVQKu+Hq3seZ1MdRjRdJ/XBH6naDD3LckwduH 8Eu37gTlODP4HQL26bwFP/N5r7kpK1mwXBHGizDZHiBvJRvdZbnRr9NV4BLBuEQomlvZ FPjOl/TR4CFgGH3zHYanOuZmjFwmCDXccplqoyTEPEDuaQ4JCrVJO/yCgvH+fpDsgAtz c6f3nzxlSx5cxoaRH9uEBV9bWkgjGsepiyLGK+8kjDIVJGoxmNy1j4yBlFoYxk2jmMPB Vshg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=ZZlz11YIUzE6r/D19TktKWKcegkjhIT0PYr0FgYcjvM=; b=qu6FN70W0UUKBdiXlslnULYSAxe4kH2EOCcPenTaflbGOz++5zksbwwfkWVdvt6OEu uTt3U5zAYJCRYJLCdz+W0k/BzCZhDmjx/W1ytJKPF2EKTJOR1cmNWLXZONyWQS6hxm+k t9ioQ+Fkbs5aMabZjV9ZnKfUIvXduOweNyssX1yK00VVMc6J4jk/XN9Sb6k/npcnn9qW Ld+82MfuXKV53lzkTe3+9mrCK8vk2Hx29eb9IvjmrSdUSh3fadSdllt00uLklETJ/Tjg Cu46joxwYSqgmDpT084oSQKoYtj32CO3gJ4Jy5T/FBz73vygsao7u3S6lmdUh8x3Dq3Y r9YA== X-Gm-Message-State: AHPjjUhfQRwExH0MP/Nt04NXb10HKO9LUVBk+FMWzYQPAlersDkU5/s8 rBC4UX1rAY1Mh4BA+eYz8+uOwU6Q X-Google-Smtp-Source: AOwi7QB6bMCUolLB0xFfudv0T6skmRe0+gqeGVFzQvxhVZ/ydkRmByUqyq0y6Nd3REfOTsYXNkZJVg== X-Received: by 10.98.110.70 with SMTP id j67mr24428036pfc.63.1507233394098; Thu, 05 Oct 2017 12:56:34 -0700 (PDT) From: Bart Schaefer Message-Id: <171005125647.ZM9377@torch.brasslantern.com> Date: Thu, 5 Oct 2017 12:56:47 -0700 In-Reply-To: <87h8vdogvw.fsf@gmail.com> Comments: In reply to Leah Neukirchen "Re: Coreutils-like File Completion" (Oct 5, 3:37pm) References: <87h8vdogvw.fsf@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org, zsh-workers@zsh.org Subject: Re: Coreutils-like File Completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 5, 3:37pm, Leah Neukirchen wrote: } Subject: Re: Coreutils-like File Completion } } Eric Cook writes: } } > On another note, if you type an ' before pressing tab, zsh will } > still complete the filename and add the closing ' if an file is } > selected, the closing ' won't be added if the selected item is an } > directory (since you may attempt to do further completion). } } This only seems to happen without compinit, anyone know how to revert } to this behavior and still use compinit? } (With compinit, ' is removed on TAB and the completion uses \ here...) Hmm, I don't see your behavior. I have a directory full of deliberately strangely-named files just for testing stuff like this. torch% ls *' '* two three with spaces a (test): bar foo dir two: dir3 file two torch% print 'w torch% print 'with spaces' torch% echo 'a a'\''b abc answerfile a (test)/ Notice how, in the file name that contains a single quote, the listing has closed the quote after the first "a", then backslashed the embedded single quote, and then opened the quotes again before "b". If I cycle the matches by repeately pressing TAB: torch% echo 'a torch% echo 'a'\''b torch% echo 'abc' torch% echo 'answerfile' torch% echo 'a (test)/ And so on. This is all with compinit having run. You should make sure that you're not confusing completion with expansion, and for zstyles or setopts that may be making a difference. There is a bit of a glitch above -- "a'b" is a directory, but the trailing "/" is not being appended, and completion into that directory doesn't work; the multiple quotings have confused path completion. It works if I allow completion to supply the quoting: torch% echo a torch% echo a\'b/ It also works if I start from a double quote so that it's not necessary to close and reopen the single quotes: torch% echo "a torch% echo "a'b/ Figuring out what the user means in order to unwind it, do a path search, and then put it all back again, is of necessity heuristic, and doesn't always work.