[Monodevelop-patches-list] r1906 - trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Jul 5 20:57:47 EDT 2004


Author: jluke
Date: 2004-07-05 20:57:46 -0400 (Mon, 05 Jul 2004)
New Revision: 1906

Modified:
   trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs
Log:
pass on the environment


Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs	2004-07-06 00:51:36 UTC (rev 1905)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Pads/TerminalPad.cs	2004-07-06 00:57:46 UTC (rev 1906)
@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 
 using MonoDevelop.Services;
 using MonoDevelop.Core.Properties;
@@ -15,7 +16,6 @@
 		Frame frame = new Frame ();
 		Terminal term;
 
-		ResourceService resourceService = (ResourceService) ServiceManager.Services.GetService(typeof(IResourceService));
 		TaskService taskService = (TaskService) MonoDevelop.Core.Services.ServiceManager.Services.GetService (typeof (TaskService));
 		IProjectService projectService = (IProjectService) ServiceManager.Services.GetService (typeof (IProjectService));
 		PropertyService propertyService = (PropertyService) ServiceManager.Services.GetService (typeof (PropertyService));
@@ -72,9 +72,19 @@
 			//FIXME: whats a good default here
 			//term.SetSize (80, 5);
 
-			// FIXME: pass the environment along
-			term.ForkCommand (Environment.GetEnvironmentVariable ("SHELL"), Environment.GetCommandLineArgs (), new string[] {""}, Environment.GetEnvironmentVariable ("HOME"), false, true, true);
+			// seems to want an array of "variable=value"
+                	string[] envv = new string [Environment.GetEnvironmentVariables ().Count];
+                	int i = 0;
+			foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
+			{
+				if (e.Key == "" || e.Value == "")
+					continue;
+				envv[i] = String.Format ("{0}={1}", e.Key, e.Value);
+				i ++;
+			}
 
+			term.ForkCommand (Environment.GetEnvironmentVariable ("SHELL"), Environment.GetCommandLineArgs (), envv, Environment.GetEnvironmentVariable ("HOME"), false, true, true);
+
 			term.ChildExited += new EventHandler (OnChildExited);
 
 			VScrollbar vscroll = new VScrollbar (term.Adjustment);




More information about the Monodevelop-patches-list mailing list