Message from discussion
zsh fix not working inside thunderbird's external editor
Received: by 10.224.59.73 with SMTP id k9mr12057541qah.4.1342395882796;
Sun, 15 Jul 2012 16:44:42 -0700 (PDT)
X-BeenThere: vim_mac@googlegroups.com
Received: by 10.229.178.19 with SMTP id bk19ls5565874qcb.0.gmail; Sun, 15 Jul
2012 16:44:38 -0700 (PDT)
Received: by 10.224.31.135 with SMTP id y7mr12088308qac.5.1342395878540;
Sun, 15 Jul 2012 16:44:38 -0700 (PDT)
Received: by 10.224.31.135 with SMTP id y7mr12088306qac.5.1342395878524;
Sun, 15 Jul 2012 16:44:38 -0700 (PDT)
Return-Path: <mail_ben_schm...@yahoo.com.au>
Received: from nm10-vm0.bullet.mail.bf1.yahoo.com (nm10-vm0.bullet.mail.bf1.yahoo.com. [98.139.213.147])
by gmr-mx.google.com with SMTP id z30si3881156qcd.3.2012.07.15.16.44.38;
Sun, 15 Jul 2012 16:44:38 -0700 (PDT)
Received-SPF: neutral (google.com: 98.139.213.147 is neither permitted nor denied by best guess record for domain of mail_ben_schm...@yahoo.com.au) client-ip=98.139.213.147;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 98.139.213.147 is neither permitted nor denied by best guess record for domain of mail_ben_schm...@yahoo.com.au) smtp.mail=mail_ben_schm...@yahoo.com.au; dkim=pass (test mode) header...@yahoo.com.au
Received: from [98.139.212.151] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 15 Jul 2012 23:44:38 -0000
Received: from [98.139.211.197] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 15 Jul 2012 23:44:38 -0000
Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 15 Jul 2012 23:44:38 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.au; s=s1024; t=1342395878; bh=veiFm4pyACCMzve5zfQfGDv712/dhEsUXPQrgyG0Clo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=QoS7b345Lv2SNrEH6Xk/V0hZnmCin6664+1qPZ4Hscm9LKUEjHjX9lgo+6Tt4zP3UU64i4SwKzr0wWyB7U1EIxM1rz5ZCrFEFSMb0qoZ2hGm0l3d/MXYFJCk1BzSzBSxHzHqPP6aXDWC/uyQbppEB9VI2CMOV3xnZaihRMpXn+w=
X-Yahoo-Newman-Id: 169275.54147...@smtp206.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: 9iGEs5YVM1luGpQhZ.vEKUUHyXNh2mw4V2McuTadu7elGMx
c1_R3y4uGEiTY1ASWuc04NUTu15Qzr38BJpY1LTl51JgQMw.WbMOVBFpaTKx
FzPcXFHYS80ON1DY0lqjyr.mlrQQpm6_EvSBOMnrtjGBLb1ZmHFY6neRqcV6
YVHkF_T3s4wvepr2VCrl2L4JTJJpXG.s4FiP0LA3YKCDP16Z3TOOeWc9RpkQ
JxCZIZZZEf3vNsTH7E4JInfMjzp8Tcr4G5yHKgxdNW4PmgyvaV2JJzC36T5Z
yIAIXLyPU5PxEQkMOSGmJH0AmxI.ylaJWLCw3hEvCFnUNtpU5IPuCZ1U8aqw
5QJB3CVLGKIdI2Zgs.HZ8Ftf9_jz3NEQhXq4QGXgaIy9MqzOn1QBHRx58.7Q
QWqj5McCsUt2kitjobv9fZocntTfOkt246BzEJzI30YYyNIW.C2uJgzl_EWr
81oIegzCC
X-Yahoo-SMTP: enFMnPSswBAexaHyzgobwuUTrYOhZdJ0KRA2SjA-
Received: from Thoughtful.local (mail_ben_schm...@110.175.52.23 with plain)
by smtp206.mail.bf1.yahoo.com with SMTP; 15 Jul 2012 16:44:37 -0700 PDT
Message-ID: <500355DD.3010...@yahoo.com.au>
Date: Mon, 16 Jul 2012 09:44:29 +1000
From: Ben Schmidt <mail_ben_schm...@yahoo.com.au>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
MIME-Version: 1.0
To: vim_mac@googlegroups.com
CC: Penny Leach <penelope.le...@gmail.com>
Subject: Re: zsh fix not working inside thunderbird's external editor
References: <efe612b9-6ea7-43fa-8418-861fae27a...@m3g2000vbl.googlegroups.com>
In-Reply-To: <efe612b9-6ea7-43fa-8418-861fae27a...@m3g2000vbl.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 6/07/12 5:29 AM, Penny Leach wrote:
> Hi there,
>
> I found the fix for the zsh problem in the troubleshooting page on the
> wiki and it works perfectly for me if I launch macvim in any sort of
> ordinary way. However, I'm using the external editor plugin for
> Thunderbird, and when it launches macvim, the PATH variable is not set
> properly.
>
> The launch command for the thunderbird plugin is: /Applications/
> MacVim.app/Contents/MacOS/Vim -g --nofork
>
> I don't see any good reason for this to cause the zsh variables to not
> be read, any insight would be appreciated.
>
> Thanks,
> Penny
This doesn't work because starting a MacVim instance using the Vim
executable directly, or the mvim script, inherits the environment of the
caller. It doesn't go through the login shell like when using the New
Window menu command inside MacVim.
I get around this by means of a wrapper script that runs MacVim in a
login shell. My script is /Users/ben/bin/loginvim:
#!/bin/bash -l
/usr/local/bin/mvim "$@"
mvim is from the MacVim distribution, but installed to /usr/local.
Notice the -l argument to bash on the shebang line makes bash act as a
login shell when the script is executed and it therefore sources all the
relevant login scripts, like in Terminal.app or MacVim's New Window menu
command.
I then have Thunderbird's External Editor extension set to execute
/Users/ben/bin/loginvim -f and it works just fine.
After a bit of experimentation, I think the following will work for zsh.
It's a bit nasty (shells everywhere) but login was crashing when I used
it in a shebang line, so I had to do this:
#!/bin/sh
/usr/bin/login -f "$USER" /bin/zsh /usr/local/bin/mvim "$@"
You or someone else might know of some other magic, though. I'm not
really familiar with zsh, so I'm just feeling my way around.
Cheers,
Ben.