delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/05/22/07:19:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=puTd99vADNvUeIq8
tnJXoSBFfiqc2pWOKl9ShwOkHDPYQGHWdTE6bBr9dEy2qbqdbsk5yJLY57Ub9/Kb
OmUzwv1eWXYVCzzCx070y1E6/BPuckKKk72J9zNiqhf6HvVkvWs6tlSZclLHiWhG
bzr4jBKbHiYGqLrd+T3LDgdDqpI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:cc:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=qEpVOMbfXg8oneVf+WIyNC
14nEs=; b=XueNdgvhavUQdB3xVkIqPIUUM5rRh+YRxQeO4UpJ2Rk13oOkJcYfDK
eatcTCTYLphLkrLCKIbLb6HJcAinl7uiC2oSxvVgjzQ8sqGE7GGCsAwT7TY+/8Ws
yQybg2Nl+geZs5riiamBIaWGDeZhx4sz78sWVXH88U1j0LppK4BFk=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=xterm, shells, commander, xwinxdgmenu
X-HELO: out1-smtp.messagingengine.com
X-ME-Sender: <xms:I8kiWSoSFSbxOLmjbGu3UYMvOnqFfL5TC8_r27zx1VPZvaZrbCR0gw>
Subject: Re: xwin-xdg-menu terminal not picking up my environment
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
References: <58cf07e3f072f30b6e6311937fb100b0 DOT squirrel AT mx DOT sdf DOT org>
Cc: petercon AT sdf DOT org
From: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
Message-ID: <7186302c-9fca-d3b9-0597-099dec673fa3@dronecode.org.uk>
Date: Mon, 22 May 2017 12:18:57 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <58cf07e3f072f30b6e6311937fb100b0.squirrel@mx.sdf.org>

On 21/05/2017 18:18, petercon AT sdf DOT org wrote:
> The xwin-xdg-menu's terminal does not seem to pick up the environment
> variables I have set in my home directory when I use it's terminal to run
> a non-x program from /bin. i.e. I added Midnight Commander to the
> xwin-xdg-menu (using alacarte)  seting /bin/mc as the executable and check
> the "run in terminal?" box. I prefer to use joe or nano as the editor in
> mc and have turned off mc's internal editor which picks up the editor in
> the "EDITOR" environment variable which I set in ~/.bashrc (I also tried
> setting it in ~/.bash_profile and ~/.profile). Mc comes up with vi (which
> is the default in mc if no "EDITOR" environment variable is set). I can
> run an XTerm from the xwin-xdg-menu and then launch mc from that and it
> honors the "EDITOR" environment variable.
> 
> By the way if I shell out (Ctrl-O) from mc and execute "env" the "EDITOR"
> variable shows up in the list. Weird. So where does xwin-xdg-menu's
> terminal get it's environment from?
xwin-xdg-menu shouldn't be doing anything to the environment, and 
especially not based on if it's running a terminal...

If you're starting it from the start menu item, it inherits the 
environment from the login shell which that uses to run startxwin, and 
the processes it starts inherit that environment in turn.

The behaviour of bash in this area is complex (see the section 
"INVOCATION" in the man page), but I suspect that any other 
non-interactive shells in the ancestry of the mc process won't have run 
startup scripts. So, if you've made a change to bash startup files, 
you'd need to restart xwin-xdg-menu to see a change.


--
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