delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/09/01/20:03:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_20,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD,SARE_SUB_ENC_UTF8,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Andy <AndyMHancock AT gmail DOT com>
Subject: Shelling out to cygwin bash from Windows vim Options =?utf-8?b?CQ==?=
Date: Sun, 2 Sep 2012 00:02:26 +0000 (UTC)
Lines: 20
Message-ID: <loom.20120902T020050-387@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

This problem dogged me for many years, and I finally hunkered down to
chase it down.

Here is the solution that I found works for me:

"set shell=c:\cygwin\bin\bash.exe\ -i
   "Won't always find ~/.bashrc cuz depending on how vim is launched,
   "~ doesn't always resolve to c:/cygwin/home/$USERNAME
"let &shell='c:\cygwin\bin\bash.exe\ --rcfile c:\cygwin\home\' .
"  \ $USERNAME . '\.bashrc'
      "Backslashes are hated by bash.  Also needs -i to ensure bash is
      "interactive so that .bashrc is sourced
let &shell='c:\cygwin\bin\bash.exe --rcfile c:/cygwin/home/' .
   \ $USERNAME . '/.bashrc -i'
      " Depending on how vim is launched, c:/cygwin/home/$USERNAME
      " will sometimes be equivalent to ~.  If so, then it will be
      " replaced by ~ in &shell.

Thanks to all those who helped on the unix, bash, cygwin, and vim
forums. 


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019