SETUP: default to mintty

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jul 25 09:12:00 GMT 2011


[This time *with* patch...]

Hi guys,

we discussed this back in May already, but somehow we didn't get a
final result.  The thread was kind of confusing, so I re-open a new
one now.

We talked about using mintty as our default shell.  I created a setup
patch which I attached to this mail again.  Instead of "Cygwin Bash
Shell" in the start menu and "Cygwin" on the desktop, it creates 
"Cygwin Terminal" shortcuts in both of them.

Is that ok?

If not, what should we do better?

Apart from that, why is mintty still not in the "Base" category?
Just laziness on our side?  Some really important reason?


Corinna


Index: desktop.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/desktop.cc,v
retrieving revision 2.56
diff -u -p -r2.56 desktop.cc
--- desktop.cc	25 Jul 2011 08:59:15 -0000	2.56
+++ desktop.cc	25 Jul 2011 09:10:47 -0000
@@ -20,7 +20,7 @@
 
 #if 0
 static const char *cvsid =
-  "\n%%% $Id: desktop.cc,v 2.56 2011/07/25 08:59:15 corinna Exp $\n";
+  "\n%%% $Id: desktop.cc,v 2.55 2010/11/19 15:49:54 cgf Exp $\n";
 #endif
 
 #include "win32.h"
@@ -78,7 +78,8 @@ DesktopSetupPage::DesktopSetupPage ()
 static void
 make_link (const std::string& linkpath,
            const std::string& title,
-           const std::string& target)
+           const std::string& target,
+           const std::string& arg)
 {
   std::string fname = linkpath + "/" + title + ".lnk";
 
@@ -96,7 +97,7 @@ make_link (const std::string& linkpath,
   if (IsWindowsNT ())
     {
       exepath = target;
-      argbuf = " ";
+      argbuf = arg;
     }
   else
     {
@@ -105,6 +106,8 @@ make_link (const std::string& linkpath,
       GetWindowsDirectory (windir, sizeof (windir));
       exepath = std::string(windir) + "\\command.com";
       argbuf = "/E:4096 /c " + target;
+      if (arg.size ())
+	argbuf += " " + arg;
     }
 
   msg ("make_link_2 (%s, %s, %s, %s)",
@@ -115,7 +118,8 @@ make_link (const std::string& linkpath,
 }
 
 static void
-start_menu (const std::string& title, const std::string& target)
+start_menu (const std::string& title, const std::string& target,
+	    const std::string& arg)
 {
   LPITEMIDLIST id;
   int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0;
@@ -137,11 +141,12 @@ start_menu (const std::string& title, co
     }
 // end of Win95 addition
   path += "/Cygwin";
-  make_link (path, title, target);
+  make_link (path, title, target, arg);
 }
 
 static void
-desktop_icon (const std::string& title, const std::string& target)
+desktop_icon (const std::string& title, const std::string& target,
+	      const std::string& arg)
 {
   char path[MAX_PATH];
   LPITEMIDLIST id;
@@ -161,7 +166,7 @@ desktop_icon (const std::string& title, 
       msg ("Desktop directory for deskop link changed to: %s", path);
     }
 // end of Win95 addition
-  make_link (path, title, target);
+  make_link (path, title, target, arg);
 }
 
 static void
@@ -243,15 +248,17 @@ do_desktop_setup ()
 
   make_cygwin_bat ();
 
+  std::string target;
+
+  target = is_legacy ? batname : backslash (cygpath ("/bin/mintty"));
+
   if (root_menu)
-    {
-      start_menu ("Cygwin Bash Shell", batname);
-    }
+    start_menu (is_legacy ? "Cygwin Bash Shell" : "Cygwin Terminal", target,
+    		is_legacy ? "" : "-");
 
   if (root_desktop)
-    {
-      desktop_icon ("Cygwin", batname);
-    }
+    desktop_icon (is_legacy ? "Cygwin" : "Cygwin Terminal", target,
+		  is_legacy ? "" : "-");
 }
 
 static int da[] = { IDC_ROOT_DESKTOP, 0 };
@@ -425,8 +432,11 @@ DesktopSetupPage::OnActivate ()
       else
 	{
 	  root_menu =
-	    check_startmenu ("Cygwin Bash Shell",
-			     backslash (cygpath ("/cygwin.bat")));
+	    is_legacy
+	    ? check_startmenu ("Cygwin Bash Shell",
+			       backslash (cygpath ("/cygwin.bat")))
+	    : check_startmenu ("Cygwin Terminal",
+			       backslash (cygpath ("/bin/mintty")));
 	}
 
       if (NoDesktopOption) 
@@ -436,7 +446,10 @@ DesktopSetupPage::OnActivate ()
       else
 	{
 	  root_desktop =
-	    check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat")));
+	    is_legacy
+	    ? check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat")))
+	    : check_desktop ("Cygwin Terminal",
+			     backslash (cygpath ("/bin/mintty")));
 	}
     }
 


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-apps mailing list