[Rd] Odd behavior on Windows: Rgui responds to user interrupts (Ctrl-C) at the Windows command prompt (iff launched from one)

Henrik Bengtsson hb at biostat.ucsf.edu
Fri Apr 25 23:16:02 CEST 2014

On Windows,

1. Open the Windows Command interpreter (cmd.exe).

2. Launch rgui.exe --vanilla.

2. In RGui, (disable Misc -> Buffered output) and run the following
endless loop:

> i <- 0; repeat { print(i <- i + 1); Sys.sleep(0.1) }
[1] 1
[1] 2
[1] 3

3a. Back at the Windows command line, press Ctrl-C (user interrupt).
This will interrupt Rgui!

3b. Alternatively, start Rterm.exe and press Ctrl-C. It will also
interrupt Rgui.

Additional observations:
* The user interrupt in the Windows command interpreter, interrupts
*all* running Rgui:s.
* A user interrupt in *any* Windows command interpreter, will interrupt Rgui.
* This only occurs if Rgui is started via the Windows command line
(cmd.exe).  It does not occur if launched directly.

Can anyone else reproduce this?  Is this an R or an OS feature?


Session info:

PATH="C:\Program Files\R\R-3.1.0\bin\i386"

C:\tmp>R --quiet --vanilla -e "sessionInfo()"
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: i386-w64-mingw32/i386 (32-bit)

[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

More information about the R-devel mailing list