This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 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: Proposed patch to system.XWinrc

Jon TURNEY wrote:
jose isaias cabrera wrote:
"Ken Brown" wrote...
What's the reason for launching everything using sh rather than bash? If I'm reading the bash documentation correctly, it means that ~/.bash_profile won't get executed (though it would get executed if it were renamed ~/.profile).

I've always wondered the same thing...

Always assuming that /bin/bash exists, or that /bin/sh is bash is probably bad style for portability across unicies.

However, in this specific case, it's probably ok.

I guess what I should have said is that only the first style point is relevant here, and is a non-issue if we arrange for the X server to explicitly depend on bash.

So, attached patch changes X server to start processes using '/bin/bash -l -c'. setup.hint should also be changed to add bash to the X server's requires:

This will give a 'consistent user experience' in a default install as the prompt in an xterm will then be the same as in a DOS shell or mintty window :-)

>From 566f2f023e8c30de7629c7b65a28c45bdc012378 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <>
Date: Tue, 30 Jun 2009 17:42:39 +0100
Subject: [PATCH] Execute commands using a login bash shell

Change executing commands in XWinrc from using '/bin/sh -c' to using '/bin/bash -l -c'
Tidy up system.Xwinrc, give xterm a scroll bar

(after applying this patch, setup.hint should be changed to add bash to X server's dependencies)

(orginally from a patch by Ken Brown <>)
 hw/xwin/_usr_X11R6_lib_X11_system.XWinrc |    7 +++++--
 hw/xwin/winprefs.c                       |    5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
index 2360bfc..8e74d0c 100644
--- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
+++ b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
@@ -18,6 +18,9 @@
 #                               ^^ This command will have any "%display%"
 #                                  string replaced with the proper display
 #                                  variable (i.e.<display>.0)
+#                                  (This should only rarely be needed as
+#                                  the DISPLAY environment variable is also
+#                                  set correctly)
 #  or	<Menu Text>	MENU	<name-of-some-prior-defined-menu>
 #  or	<Menu Text>	ALWAYSONTOP
 #                         ^^ Sets the window to display above all others
@@ -79,8 +82,8 @@
 // Make some menus...
 menu apps {
-	xterm	exec	"xterm"
-	"Emacs"		exec	"emacs"
+	xterm	exec	"xterm -sb"
+	"Emacs"	exec	"emacs"
 	notepad	exec	notepad
 	xload	exec	"xload -display %display%"  # Comment
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index c5fd7eb..6d7073d 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -371,8 +371,9 @@ HandleCustomWM_COMMAND (unsigned long hwndIn,
 		      /* Disassociate any TTYs */
-		      execl ("/bin/sh",
-			     "/bin/sh",
+		      execl ("/bin/bash",
+			     "/bin/bash",
+			     "-l",

Unsubscribe info:
Problem reports:

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