Bug 14948 - Windows R on control-C closes but terminal still stealing input
Windows R on control-C closes but terminal still stealing input
Status: RESOLVED FIXED
Product: R
Classification: Unclassified
Component: Windows GUI / Window specific
R 2.15.0 patched
All Windows 64-bit
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-18 15:33 UTC by Matt Hickford
Modified: 2012-06-19 18:50 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hickford 2012-06-18 15:33:30 UTC
I open a Windows command prompt. I run R `R`. When I press Control-C in the R terminal, something weird happens. It appears to exit R and take me back to the command prompt, BUT now when I type commands they are fought over by the command prompt and a R terminal hiding in the background . What's going on?

    C:\Users\hickfordm>R

    R version 2.15.0 (2012-03-30)

    > ^C
    c:\users\hickfordm>dir
    'ir' is not recognized as an internal or external command, operable program or batch file.
    
    c:\users\hickfordm>
    Error: object 'd' not found

Edit: This happens to me only if I run `R`. If I run `Rterm`, control-C does nothing, which is reasonable.

http://stackoverflow.com/questions/10512743/what-is-happening-when-i-press-control-c-in-the-r-terminal
Comment 1 Duncan Murdoch 2012-06-18 20:42:42 UTC
On 12-06-18 10:33 AM, r-bugs@r-project.org wrote:
> https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=14948
>
>             Summary: Windows R on control-C closes but terminal still
>                      stealing input
>             Product: R
>             Version: R 2.15.0 patched
>            Platform: All
>          OS/Version: Windows 64-bit
>              Status: NEW
>            Severity: normal
>            Priority: P5
>           Component: Windows GUI / Window specific
>          AssignedTo: R-core@R-project.org
>          ReportedBy: matt.hickford@gmail.com
>     Estimated Hours: 0.0
>
>
> I open a Windows command prompt. I run R `R`. When I press Control-C in the R
> terminal, something weird happens. It appears to exit R and take me back to the
> command prompt, BUT now when I type commands they are fought over by the
> command prompt and a R terminal hiding in the background . What's going on?
>
>      C:\Users\hickfordm>R
>
>      R version 2.15.0 (2012-03-30)
>
>      >  ^C
>      c:\users\hickfordm>dir
>      'ir' is not recognized as an internal or external command, operable program
> or batch file.
>
>      c:\users\hickfordm>
>      Error: object 'd' not found
>
> Edit: This happens to me only if I run `R`. If I run `Rterm`, control-C does
> nothing, which is reasonable.
>
> http://stackoverflow.com/questions/10512743/what-is-happening-when-i-press-control-c-in-the-r-terminal
>


I can confirm this --- I'll take a look.  What appears to be happening 
is that the Ctrl-C kills the R process, but R started Rterm, and the 
Rterm process is still running.

Windows documentation for console-mode programs is notoriously awful, so 
I'm not sure I'll be able to find how to fix this, but I'll try.  In the 
meantime, just like the doctor said, "don't do that".

Duncan Murdoch


Comment 2 Duncan Murdoch 2012-06-19 03:13:30 UTC
I think this is fixed now in R-devel. I've only tested it on a virtual 32 bit machine.  If it works out on others, I'll backport it to R-patched after the 2.15.1 release.
Comment 3 Matt Hickford 2012-06-19 18:50:06 UTC
Fast work, thanks Duncan