From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 736 invoked by alias); 6 Mar 2013 16:29:05 -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: 17669 Received: (qmail 14305 invoked from network); 6 Mar 2013 16:29:03 -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.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.223.176 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Cc/fVOgkSzjm+vtOcxrd12oJlnyZJdXKjTgdIT0vQQc=; b=kUQMVLgQRlAi89W9Z34QKW4DIaeNU1T370VCv1G613CzjVFHJH+qX4T7HLxZNgpi0J NxC+uC/hqXY/Ndtd2p9XxqPs99S5CWnjnZEPAuWyjSnz0YRqgu2EOmzp4e0k9J946YU7 AjOK4vvIMALnqYkqDjbDDCoN3o8t8g5FI1S7UQY3hsogq/qX7xB1/zuxH4z/T3EFx8Sy Dg+mMlq703E0JYrc+vqFEBPlA3eA6rmnTX3RUuZa/IHOalb56bEC8/3TGg9p1qWPAXVX YH5ca7sVwo1rQaC2cETMeRGd58xedMxeTOUTixPtaaBsxJ4+ChKeJ4iSCDZ/Q3U2VJp0 9VAQ== X-Received: by 10.50.17.201 with SMTP id q9mr10791727igd.107.1362587337741; Wed, 06 Mar 2013 08:28:57 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <130306075216.ZM10086@torch.brasslantern.com> References: <130306075216.ZM10086@torch.brasslantern.com> From: Ramkumar Ramachandra Date: Wed, 6 Mar 2013 21:58:37 +0530 Message-ID: Subject: Re: Completion: smarter symlink completion To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Bart Schaefer wrote: > On Mar 6, 8:37pm, Ramkumar Ramachandra wrote: > } > } I noticed that symlinks are always completed with the trailing slash > > I presume you mean symlinks whose targets are directories? If symlinks > whose targets are files are getting a trailing slash, that would clearly > be strange. > > } like directories, and unlike normal files. This can be problematic if > } the user runs `rm -r` on a symlink by mistake. > > Does autoremoveslash not take the slash away again before the command > is executed? It certainly does for me. AUTO_REMOVE_SLASH works, thanks. > In any case I'd say running rm -r by mistake is a problem independent of > how the file name was completed. If you have a rash of people running > rm -r accidentally, why aren't you worried about real directories? Agreed. I crafted the problem mostly out of theoretical interest; it doesn't arise from a real-world itch. > } Is this really a bug, or am I misunderstanding something? > > The assumption is that when completing a directory (whether symlink > or not), there's every likelyhood that the directory itself is not the > end result, and you're going to continue completing other files down > the tree. The slash is appended to (a) make that obvious and (b) not > require that you switch back and forth between TAB and / keys in order > to continue completing (unless the directory name itself was part of > an ambiguous list). Makes sense, thanks. Yes, I'd want zsh to follow symlinks and operate on the tree of the underlying directory.