delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/30/10:23:31

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Date: Mon, 30 Mar 2009 22:22:56 +0700
From: bjoe <eco94h AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Mintty running program from shortcut problem
Message-ID: <20090330152256.GA3912@komputer03>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <416096c60903141419s1472e9e4gb743d1f1b346fe0a AT mail DOT gmail DOT com>
Mime-Version: 1.0
In-Reply-To: <416096c60903141419s1472e9e4gb743d1f1b346fe0a@mail.gmail.com>
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

On Sat, Mar 14, 2009 at 09:19:57PM +0000, Andy Koppe wrote:
> > When we running program with mintty from shortcut, mintty will
> > running the program in non login shell without knowing cygwin PATH.
> > This will make some kind of error When program try to running
> > external program like info run gzip or using shell escape in vim.
> > Is this expected behavior?
> 
> Yep.
> 
> $ mintty --help
> Usage: ./mintty [OPTION]... [COMMAND [ARGS]...]
> 
> If no command is given, the user's default shell is invoked as a non-login
> shell. If the command is a single minus sign, the default shell is invoked
> as a login shell. Otherwise the command is invoked with the given arguments.
> ...
> 
> It's much the same for rxvt (and xterm) btw: without arguments they
> invoke a non-login shell, and to get a login shell you have to tell
> them with option -ls.
> 
Ok, this is normal behavior 
> 
> > Making mintty shortcut running info with this code:
> > <code>
> > bayu AT semampir ~
> > $ mkshortcut -D -i /usr/bin/mintty.exe -w /usr/bin -a "info"
> > /usr/bin/mintty.exe
> > <code>
> >
> > When I try to enter the node info produce error like this:
> > gunzip < /usr/share/info/as.info.gz.../bin/sh: gunzip: command not
> > found Cannot find node `Top'.
> > note: Making shortcut manually also produce same problem
> 
> The problem is that the PATH variable isn't set up, so info can't find
> gunzip. Invoking a login shell does set up PATH (in /etc/profile), but
> that's not necessary.
> 
Invoking login shell making additional overhead and execution time
that unnecessary.
> 
> > This error not found when using rxvt
> > <code>
> > bayu AT semampir ~
> > $ mkshortcut -D ?-i /usr/bin/cygicons-0.dll -j8 -w /usr/bin -a "-p
> > /usr/bin rxvt -e info" ?/usr/bin/run.exe
> > <code>
> 
> The difference here is that you're adding /usr/bin to the PATH using
> the -p option to run.exe.
> 
> It appears that invoking MinTTY through run.exe keeps its window
> hidden, which I guess is what run.exe is supposed to do: "run - start
> programs with hidden console window". I don't know why that's
> different for rxvt.
> 
> 
> > To avoid this trouble use bash -lc <command> so mintty will run bash
> > in login shell first.
> >
> > <code>
> > bayu AT semampir ~
> > $ mkshortcut -D -i /usr/bin/mintty.exe -w /usr/bin -a "bash -lc
> > /usr/bin/info" /usr/bin/mintty.exe
> > <code>
> 
> As mentioned above, invoking a login shell is overkill here. Just
> setting PATH will do:
> 
> $ mkshortcut -D -i /usr/bin/mintty.exe -w /usr/bin -a "sh -c
> 'PATH=/bin info'" /usr/bin/mintty.exe
> 
> Alternatively, you could add C:\cygwin\bin to the Windows Path variable.
> 
It's working, I hope you will add this in your man page.
> Andy

-- 
It is easy to say no when
          there is a deeper yes burning within

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

- Raw text -


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