This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 10351
  Use a login bash shell to execute commands started from the tray menu Last modified: 2009-10-13 05:03:26
     Query page      Enter new bug
Bug#: 10351   Hardware:   Reporter: Jon TURNEY <jon.turney@dronecode.org.uk>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Status: RESOLVED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: Cygwin/X maintainer <yselkowitz@cygwin.com>   Target Milestone:  
Summary:
Keywords:

Attachment Description Type Created Actions
0001-Execute-commands-using-a-login-bash-shell.patch Patch to use login bash shell for tray menu commands patch 2009-06-30 16:58 Edit | Diff
xinit-bash-l-and-checkX.patch patch for ports/xorg/xinit patch 2009-09-30 17:22 Edit | Diff
0001-Tidy-up-system.Xwinrc-give-xterm-a-scroll-bar.patch Tidy ups for system.Xwinrc patch 2009-10-04 14:59 Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 10351 depends on: Show dependency tree
Show dependency graph
Bug 10351 blocks:

Additional Comments:


Leave as RESOLVED FIXED
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2009-06-30 16:58
Following discussion at http://cygwin.com/ml/cygwin-xfree/2009-06/msg00010.html,
change to using a login bash shell to execute the commands started from the tray
menu

------- Additional Comment #1 From Jon TURNEY 2009-06-30 16:58 -------
Created an attachment (id=4031)
Patch to use login bash shell for tray menu commands

------- Additional Comment #2 From Cygwin/X maintainer 2009-07-02 18:08 -------
Thanks; patch added to the queue for the next release.

------- Additional Comment #3 From Cygwin/X maintainer 2009-07-08 23:29 -------
Shipped in 1.6.2-1; closing.

------- Additional Comment #4 From Cygwin/X maintainer 2009-09-04 08:23 -------
Trying the tray menu for the first time in a while, I see that using a login
shell is expensive in terms of launch times.

If I understand the thread correctly, the problem is only if XWin is launched
directly from Windows.  Maybe startxwin.{bat,sh} should launch XWin via "bash -l
-c" instead, so the environment initialization need occur only once?

------- Additional Comment #5 From Cygwin/X maintainer 2009-09-30 17:22 -------
Created an attachment (id=4237)
patch for ports/xorg/xinit

Here is what I am thinking for this bug and bug 10598.	Can we use this
instead, and revert the patch to xserver?

------- Additional Comment #6 From Jon TURNEY 2009-09-30 20:24 -------
(In reply to comment #5)
> Created an attachment (id=4237)
> patch for ports/xorg/xinit
> 
> Here is what I am thinking for this bug and bug 10598.	Can we use this
> instead, and revert the patch to xserver?

Looks good to me.  

Don't forget that this adds run2 to the dependencies for xinit

------- Additional Comment #7 From Cygwin/X maintainer 2009-09-30 20:29 -------
(In reply to comment #6)
> Looks good to me.  
> 
> Don't forget that this adds run2 to the dependencies for xinit

That means we depend on both run and run2.  Unfortunately run2 is not a drop-in
replacement for run (run2 uses XML files instead of command-line arguments), so
we'll have to live with that for now.

------- Additional Comment #8 From Cygwin/X maintainer 2009-09-30 20:36 -------
While I'm at it, I noticed that startxwin.sh (but not the .bat) contains:

rm -rf /tmp/.X11-unix

Doing that while another XWin display is running is a bad idea.  e.g. I use :1
for multiwindow, leaving :0 open for startx launching, and testing startxwin.sh
causes clients to be unable to connect to my :1 since the socket no longer
exists.  I'm going to change that to:

rm -f /tmp/.X11-unix/X0

Just like in the .bat, since we explicitly set DISPLAY=127.0.0.1:0.0 earlier in
the script.

------- Additional Comment #9 From Cygwin/X maintainer 2009-10-01 04:19 -------
Shipped in xinit-1.1.1-5 and xorg-server-1.6.4-1; closing.

------- Additional Comment #10 From Jon TURNEY 2009-10-04 14:59 -------
Created an attachment (id=4253)
Tidy ups for system.Xwinrc

Dropping this patch has dropped some tiding up in system.Xwinrc; here's a
respun patch with just that in it...

http://cygwin.com/ml/cygwin-xfree/2009-10/msg00023.html

------- Additional Comment #11 From Jon TURNEY 2009-10-04 21:22 -------
Oh, and xterm started from the tray menu doesn't seem to inherit the correct
environment :-(

------- Additional Comment #12 From Jon TURNEY 2009-10-04 22:02 -------
(In reply to comment #11)
> Oh, and xterm started from the tray menu doesn't seem to inherit the correct
> environment :-(

Hmm.. mysterious: comparing the output of running 'C:\cygwin\bin\run bash -l -c
"env | sort >/tmp/env"' in a DOS shell, and "env | sort >/tmp/Xenv" from
system.Xwinrc, the only significant difference seems to be PS1...

------- Additional Comment #13 From Cygwin/X maintainer 2009-10-07 01:33 -------
(In reply to comment #10)
> Created an attachment (id=4253)
> Tidy ups for system.Xwinrc
> 
> Dropping this patch has dropped some tiding up in system.Xwinrc; here's a
> respun patch with just that in it...

FWIW, the default fd.o desktop menu entries launch xterm w/o any options.  I'm
not sure that we need to cater to anyone's preferences in system.XWinrc; users
should be customizing their ~/.XWinrc or ~/.Xdefaults to their tastes.

Patch, minus the '-sb' addition, added to the queue.


------- Additional Comment #14 From Jon TURNEY 2009-10-08 20:56 -------
(In reply to comment #13)
> (In reply to comment #10)
> > Created an attachment (id=4253)
> > Tidy ups for system.Xwinrc
> > 
> > Dropping this patch has dropped some tiding up in system.Xwinrc; here's a
> > respun patch with just that in it...
> 
> FWIW, the default fd.o desktop menu entries launch xterm w/o any options.  I'm
> not sure that we need to cater to anyone's preferences in system.XWinrc; users
> should be customizing their ~/.XWinrc or ~/.Xdefaults to their tastes.
> 
> Patch, minus the '-sb' addition, added to the queue.

Yes, that's probably the right thing to do.  Thanks.


------- Additional Comment #15 From Jon TURNEY 2009-10-08 21:25 -------
(In reply to comment #12)
> (In reply to comment #11)
> > Oh, and xterm started from the tray menu doesn't seem to inherit the correct
> > environment :-(
> 
> Hmm.. mysterious: comparing the output of running 'C:\cygwin\bin\run bash -l -c
> "env | sort >/tmp/env"' in a DOS shell, and "env | sort >/tmp/Xenv" from
> system.Xwinrc, the only significant difference seems to be PS1...

Learnt something new today: PS1 gets unset by non-interactive bash shells

http://git.savannah.gnu.org/cgit/bash.git/tree/shell.c, around line 600

So setting in in /etc/profile and trying to inherit it everywhere isn't going to
work :-(

------- Additional Comment #16 From Cygwin/X maintainer 2009-10-13 05:03 -------
Patch shipped in 1.6.5-1; closing.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In