Debian Bug report logs - #542430
[vim] vim try to expand files or directories that contain ~ (when using tcsh shell)

version graph

Package: vim; Maintainer for vim is Debian Vim Maintainers <[email protected]>; Source for vim is src:vim (PTS, buildd, popcon).

Reported by: gregory hainaut <[email protected]>

Date: Wed, 19 Aug 2009 16:00:03 UTC

Severity: normal

Tags: patch

Found in version vim/2:7.2.245-2

Forwarded to Bram Moolenaar <[email protected]>

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#542430: [vim] vim try to expand files or directories that  contain ~ (when using tcsh shell)
Reply-To: James Vega <[email protected]>, [email protected]
Resent-From: James Vega <[email protected]>
Original-Sender: [email protected]
Resent-To: [email protected]
Resent-CC: Debian Vim Maintainers <[email protected]>
X-Loop: [email protected]
Resent-Date: Tue, 03 Nov 2009 21:03:09 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: followup 542430
X-Debian-PR-Package: vim
X-Debian-PR-Keywords: patch
X-Debian-PR-Source: vim
Received: via spool by [email protected] id=B542430.125728156728111
          (code B ref 542430); Tue, 03 Nov 2009 21:03:09 +0000
Received: (at 542430) by bugs.debian.org; 3 Nov 2009 20:52:47 +0000
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rietz.debian.org
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 24; hammy, 111; neutral, 61; spammy,
	2. spammytokens:0.997-1--5357, 0.893-+--forward
	hammytokens:0.000-+--workaround, 0.000-+--1024D, 0.000-+--1024d, 0.000-+--GPG,
	 0.000-+--upstream
X-Spam-Status: No, score=-8.7 required=4.0 tests=AWL,BAYES_00,FROMDEVELOPER,
	HAS_BUG_NUMBER,MURPHY_DRUGS_REL8,MURPHY_WRONG_WORD2,SPF_PASS autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: from ey-out-2122.google.com ([74.125.78.27])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <[email protected]>)
	id 1N5QMv-0007Io-Nu
	for [email protected]; Tue, 03 Nov 2009 20:52:46 +0000
Received: by ey-out-2122.google.com with SMTP id d26so616897eyd.1
        for <[email protected]>; Tue, 03 Nov 2009 12:52:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:sender:received:in-reply-to
         :references:date:x-google-sender-auth:message-id:subject:from:to
         :content-type;
        bh=9UFaZXti6prqD2G4mRJBjWRQa8kUDOgErYP9wm/UWnQ=;
        b=KRPnveW0Lr4cuCm9OGBDoWUQB5iBlPj3ZYSkZ9rngjn2Z6QSSfLZ7l4pY0p8vISU7k
         HYU0UWVd0eeG8xBSdKcnao++eU2XMzIPPHbR9WZ8pi1zFtuLrZHjCanKrrh37wTY+Lge
         flcJs6Hpt69eHheEiHn9SM2/T67RrFBki8Zpw=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:content-type;
        b=p15HrlVTSrcOBx1oqP3yg30djSIFnwbBCat8k8JmAWNEnm4LPxn0a8qPZxytfdE/m/
         S0Iv6ZbMfPMNnvXMbSLQoPE6i3vuEIP7m1/EaWsT+APnPtc13BYwVclg12jehmklCSya
         Wj+WTRAAatKpLoxVS+FGjJkbJN1Ltk354/0pk=
MIME-Version: 1.0
Sender: [email protected]
Received: by 10.216.89.12 with SMTP id b12mr214415wef.93.1257281564267; Tue, 
	03 Nov 2009 12:52:44 -0800 (PST)
In-Reply-To: <[email protected]>
References: <[email protected]>
	 <[email protected]>
Date: Tue, 3 Nov 2009 15:52:44 -0500
X-Google-Sender-Auth: f03c62cc32aac5b1
Message-ID: <[email protected]>
From: James Vega <[email protected]>
To: gregory hainaut <[email protected]>, [email protected]
Content-Type: text/plain; charset=UTF-8
On Thu, Aug 20, 2009 at 9:28 AM, James Vega <[email protected]> wrote:
> On Wed, Aug 19, 2009 at 05:55:54PM +0200, gregory hainaut wrote:
>> Please find attached a patch that seems solve the problem not sure it
>> is the good solution (and works in all situations). Maybe a solution
>> will be to escaped ~ like '\~' before sending to the tcsh shell.
>
> This looks good to me.  I'll forward it upstream and see what he thinks.
> Thanks for the patch. :)

Looking into this further, this isn't actually a problem with using tcsh
or the expansion of '~'.  The problem is what that Vim isn't properly
detecting which shell you're using because you've set 'shell' to
"/bin/tcsh -f" instead of simply "/bin/tcsh".

In src/os_unix.c

5354     else if ((len = STRLEN(p_sh)) >= 3)
5355     {
5356         if (STRCMP(p_sh + len - 3, "csh") == 0)
5357             shell_style = STYLE_GLOB;

Vim checks whether the last 3 characters of 'shell' are "csh".  Since
that fails with your setting, Vim then uses an sh-compatible method for
expansion.  This obviously fails with tcsh.

So, the simple workaround for now is to simply "set shell=/bin/tcsh".
I'll send this information to Bram so he knows about it.

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[email protected]>




Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 17:28:59 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.