This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: xwin-xdg-menu terminal not picking up my environment


On 21/05/2017 18:18, petercon@sdf.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]