Proposed patch to system.XWinrc

Jon TURNEY jon.turney@dronecode.org.uk
Sat Jun 20 20:44:00 GMT 2009


Ken Brown wrote:
> On 6/17/2009 3:17 PM, Jon TURNEY wrote:
>>> +       emacs   exec    "bash -l -c /usr/bin/emacs"
>>>         notepad exec    notepad
>>>         xload   exec    "xload -display %display%"  # Comment
>>>  }
>>>
>>> The most important part of this is changing the way emacs is called; 
>>> the original version didn't work at all for me (i.e., emacs didn't 
>>> start). This might be related to the fact that I've installed the 
>>> emacs-23 packages, which use the alternatives system:
>>>
>>> /usr/bin/emacs -> /etc/alternatives/emacs
>>> /etc/alternatives/emacs -> /usr/bin/emacs-X11.exe
>>
>> The command lines for menu items are just supplied to execl('/bin/sh 
>> -c ...') after a fork, so it should have no problem following 
>> symlinks, and a bare "emacs" works for me (I tested 23.0.92 under 
>> Cygwin 1.7)
> 
> It turns out that I was using a modified startxwin.bat that didn't set 
> up the path correctly.  So now it works for me too.  Nevertheless, I 
> prefer "bash -l -c /usr/bin/emacs" so that the bash initialization files 
> are processed before emacs starts.  For various reasons, I want the 
> environment inside emacs to be the same as the usual bash environment. I 
> suspect that most emacs users would want that, but I don't really know.

Yes, I think this is a general problem: when X is started directly from DOS 
and then programs are started from the tray menu, they aren't executed in a 
login environment.  It seems unlikely this is what anyone would actually want 
(I notice my .Xwinrc is decorated with equivalent options.)  So perhaps we 
should be launching everything using '/bin/sh -l -c'? Patch attached.

But even with this, there is a difference between 'exec xterm' and 'exec xterm 
-ls' (which will use the users shell of choice from /etc/passwd, which I shall 
assume is bash), which I think is due to /etc/profile setting PS1 differently 
depending on if the shell is sh or bash...

Hmm... and now I look at it, setup should probably be installing the 
system.XWinrc into /etc/defaults, rather than overwriting it whenever the 
package is updated...
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: exec-should-use-a-login-shell.patch
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20090620/1d5b76f5/attachment.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


More information about the Cygwin-xfree mailing list