RinWIN: Character eaten by cmd or Powershell? R.exe or Rterm.exe?

Problem Description: When running R2.6.0(built with MinGW) in PowerShell (PS> /bin/R.exe), one can exit the running code with CTRL-C. However, the following situation is rather cratchy : the shell would (almost always) consequently omit the first character you type (for example, ls becomes “s” and hence is not recognized by shell anymore).

In the cmd.exe shell the same problem exists.

When I tried to start R again , the same problem is still there, some characters typed are “eaten” and all turn into a mess.

Ctrl-C definitely presents problems. For instance, on my WinXP systemrunning R from a Cygwin prompt, a Ctrl-C during the Sys.sleep killsRterm, whereas under the Windows cmd.exe prompt it works properly asit did for you.

I can guess at an explanation for what you saw, but I don't know howto fix it:

- R (as opposed to Rterm) is a small .exe program that does a littleargument parsing, then runs Rterm. It looks as though the Ctrl-C isgoing to R, and killing that process, but leaving the child processRterm running. But since both Rterm and cmd.exe are reading andwriting to standard file handles, you get the messed up prompts.

I've just tried doing what the Windows documentation says should work(adding this line before Rterm is called: