Minimalist GNU for Windows

How to start a MSYS shell

There are a couple of methods to start a MSYS shell :

How do I check if we are in a MSYS shell?

How to start a MSYS shell on Windows XP Professional x64

On Windows XP Professional x64, msys.bat opens a window that quickly closes. Looking more closely, rxvt dies with the following error.

C:\msys\1.0\bin\rxvt.exe: *** fork: can't reserve memory for stack 0x480000 - 0x680000, Win32 error 0
      0 [main] rxvt 2928 sync_with_child: child 1440(0x2CC) died before initialization with status code 0x1
     43 [main] rxvt 2928 sync_with_child: *** child state waiting for longjmp
rxvt: can't fork
rxvt: aborting

The problem is easily circumvented by running msys.bat in a 32-bit command prompt. This can be achieved with the following batch file. Let's just call it my_msys.bat. You should put it in c:\msys\1.0. Now all you have to do is to change the MSYS shortcut in Start Menu\MinGW\MSYS to point to it.

@echo off
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" SET COMSPEC=%WINDIR%\SysWOW64\cmd.exe
..\msys.bat

Or better yet, patch MSYS.bat with the diff in http://sourceforge.net/tracker/index.php?func=detail&aid=1351029&group_id=2435&atid=302435

How do I start the MSYS shell in the recommended W32 Console?

Why would I want to use the recommended W32 Console instead of RXVT?

Usage and Configuration

How do I copy and paste text, in an MSYS console?

How do I change the colors of the MSYS console?

The default rxvt font size is too small. How do I enlarge it?

Open C:\MSYS\1.0\msys.bat with a text editor and search for a line containing "80x25". Then replace it with:

start rxvt -backspacekey ^H -sl 2500 -fg grey90 -bg black -sr -fn "Courier-bold-20"
-tn msys -geometry 80x25 -e /bin/sh --login -i

You can change the Courier font above with your favorite one. Note that using TrueType fonts (such as Courier New or Lucida Console) will result in sluggish performance under Windows XP.

Why don't the Home and End keys work in rxvt and vim?

This is because rxvt's terminal emulation uses different escape codes for these two keys. You will find some discussion on this in this mailing list thread, with specific advice offered in this message and this follow-up.

The following sample ~/.inputrc file offers one possible solution for this issue; you may wish to adapt it, based on the advice offered in the above discussion thread:--

set completion-query-items 100
set completion-ignore-case on
set show-all-if-ambiguous off

set input-meta on
set output-meta on
set convert-meta off
set bell-style none

"\e[2~": paste-from-clipboard
"\e[3~": delete-char
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[7~": beginning-of-line
"\e[8~": end-of-line

Also, you need to set up your ~/.vimrc to enable the Home/End keys in ViM:

set nocompatible
set backspace=2
syntax on

map  <Esc>[7~ <Home>
map  <Esc>[8~ <End>

imap <Esc>[7~ <Home>
imap <Esc>[8~ <End>

How do I set up a profile for the MSYS Shell?

PHP Warning

lib/XmlElement.php:43 Warning[2]: get_class() expects parameter 1 to be object, string given (...repeated 9 times)

lib/XmlElement.php (In template 'navbar' < 'top' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'navbar' < 'top' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'browse' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

lib/XmlElement.php (In template 'browse' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

lib/XmlElement.php (In template 'browse' < 'body' < 'html'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

lib/XmlElement.php (In template 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

Valid XHTML 1.0! Valid CSS!
Page Execution took real: 0.082, user: 0.060, sys: 0.010 seconds , Memory: 2514456

lib/XmlElement.php (In template 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given

lib/XmlElement.php (In template 'actionbar' < 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given:

lib/XmlElement.php (In template 'actionbar' < 'browse-footer'):43 Warning[2]: get_class() expects parameter 1 to be object, string given: