Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot type 'e' or 'P' in MinGW/msys shells or terminals

I have successfully installed and used MinGW and msys in the past to compile and link Windows executables. On a fresh installation for 32-bit Vista (the same platform as when I had previous success) I am getting some maddening behavior: when I type lower-case 'e' or upper-case 'P' in the provided shell environments I get an audible beep but no character! Meaning I cannot type "make" or "echo" and then run those commands, for instance. It goes: m-a-k-BEEP!

This no 'e' BEEPing occurs in the shell that opens when you invoke msys via the shortcut that gets generated by the installer, and in shells by navigating to c:\msys\1.0\bin and just double-clicking bash.exe, sh.exe, rxvt.exe (actually that has more of a muffled noise puff than a crisp BEEP), but always lower-case 'e' and capital 'P' will not echo to the terminal (or shell? obviously I don't have a handle on the differences between these terms).

I have tried the automated MinGW and msys installers, and a fresh manual install to the same end.

I do not understand shells very well, or how their environments evolve as they start up, so I don't know where to start looking for the source of this wacky behavior.

like image 309
dim fish Avatar asked Feb 05 '11 07:02

dim fish


People also ask

What is Msys in MinGW?

In addition, a component of MinGW known as MSYS (minimal system) provides Windows ports of a lightweight Unix-like shell environment including rxvt and a selection of POSIX tools sufficient to enable autoconf scripts to run, but it does not provide a C compiler or a case-sensitive file system.

What is Msys shell?

MSYS is an application that gives the user a Bourne shell that can run configure scripts and Makefiles. No compilers come with MSYS. In the Cygwin, MinGW, and MSYS hierarchy, it is at the bottom the food chain in terms of tools provided. However, it is very easy to use and build the OS project with MSYS.


1 Answers

I'm assuming you're using Bash. It sounds to me like the key bindings have gotten messed up for some reason.

If you do this command:

bind -p|grep -i '"[pE]"'

you should get this result:

"E": self-insert
"e": self-insert
"P": self-insert
"p": self-insert

If the entries for "P" and "e" are missing then try these commands.

bind '"e":self-insert'
bind '"P":self-insert'

Obviously, you can't type the characters, so type their opposite-case version, press left-arrow, then press Alt-u to upcase the small "p" or Alt-l (that's a lower-case "ell") to downcase the capital "E" (you will need to do this for each "e" in the first command).

If that works, check the ~/.inputrc file for invalid keybindings. Also, check your startup files such as ~/.bashrc, etc. The issue is likely to be with missing or misplaced quotation marks and it may be for a key binding for something like \eP which, by default, is bound to the readline function do-lowercase-version.

like image 181
Dennis Williamson Avatar answered Sep 30 '22 04:09

Dennis Williamson