This is the mail archive of the
mailing list for the Cygwin project.
Re: xwin-xdg-menu terminal not picking up my environment
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Cc: petercon at sdf dot org
- Date: Mon, 22 May 2017 12:18:57 +0100
- Subject: Re: xwin-xdg-menu terminal not picking up my environment
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
On 21/05/2017 18:18, firstname.lastname@example.org wrote:
xwin-xdg-menu shouldn't be doing anything to the environment, and
especially not based on if it's running a terminal...
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?
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple