From luke-tier@ey m@ili@g off uiow@@edu  Thu Jul 26 15:47:20 2018
From: luke-tier@ey m@ili@g off uiow@@edu (luke-tier@ey m@ili@g off uiow@@edu)
Date: Thu, 26 Jul 2018 08:47:20 -0500 (CDT)
Subject: [Rd] 
 Possible bug: R --slave --interactive stdin echo on Linux when
 stdin is a fifo
In-Reply-To: <CABtg=K=Sk+P8uJMJNSRQoTh180P_R6B3AZ45DK9miUPcFvZy_w@mail.gmail.com>
References: <f85c602f061144619f89a71b5f056a04@AM6PR04MB4264.eurprd04.prod.outlook.com>
 <CANVKczMGuQ0n1XKRu5=sRqeTOxmA52wOeLTrff9kV8N3LcgJ-Q@mail.gmail.com>
 <CABtg=KnbkMSCgAYeiuOGJ3-kOgjc4McPhw2skS-6eyydCf8N0A@mail.gmail.com>
 <alpine.DEB.2.20.1807260738270.3311@luke-Latitude-7480>
 <CABtg=K=Sk+P8uJMJNSRQoTh180P_R6B3AZ45DK9miUPcFvZy_w@mail.gmail.com>
Message-ID: <alpine.OSX.2.21.1807260824130.1437@lukes-macbook-air.local>

On Thu, 26 Jul 2018, G?bor Cs?rdi wrote:

> On Thu, Jul 26, 2018 at 1:43 PM <luke-tierney at uiowa.edu> wrote:
>>
>> On Thu, 26 Jul 2018, G?bor Cs?rdi wrote:
>>
>>> On Thu, Jul 26, 2018 at 12:25 PM Barry Rowlingson
>>> <b.rowlingson at lancaster.ac.uk> wrote:
>>>>
>>>> On Thu, Jul 26, 2018 at 12:22 AM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
>>>>> I am trying to control a background R session, connected via a fifo /
>>>>> named pipe.
>>>>
>>>>  Is the fifo significant here? If I read the same R code from a file
>>>> via `<` I get the input echoed (R 3.4.4, Ubuntu).
>>>
>>> Yeah, for a file I get echo on both macOS and Linux, but not on Windows.
>>>
>>> I think the most useful behavior for --slave is no echo at all, maybe?
>>> But I might be missing the motivation behind --slave.
>>>
>>> Another thing is that windows does not have --interactive. Is there a
>>> way to run R
>>> 1) without echoing stdin, and
>>
>> I'm not seeing an echo for your example on Ubuntu or Fedora.
>
> Interesting. Do you mean the fifo example, or just a file? Or both?
> I wonder what this depends on then....

The fifo one -- I didn't try a file.

>
> Particularly interesting that this does echo on macOS:
> echo '1+1' | R --slave --interactive
> But the FIFO example does not.
>
> Anyway, it seems that if I remove --interactive then I get no echo.

Looks like this has to do with readline, which --interactive turns on.
If I use '--no-readline --interactive' (in that order) on Mac OS and
Linux I get no echo.

The code in R for all this should be identical on Linux and Mac OS --
both use the unix code. readline libraries may differ, shell/stty
settings may differ for your setup.

Best,

luke

>
>>> 2) without quitting on the first error,
>>> on all platforms?
>>
>> One option is to use
>>
>>      options(error = function() invokeRestart("abort"))
>
> This seems good enough for my use case, thanks much!
> Luckily, this also solves the "disabling the crash dialog" problem, which I
> have if I specify --interactive.
>
> Gabor
>
>> There may be better ways.
>>
>> Best,
>>
>> luke
>>
>>>
>>> Gabor
>>>
>>>> Barry
>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>> --
>> Luke Tierney
>> Ralph E. Wareham Professor of Mathematical Sciences
>> University of Iowa                  Phone:             319-335-3386
>> Department of Statistics and        Fax:               319-335-3017
>>     Actuarial Science
>> 241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
>> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
>

-- 
Luke Tierney
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu


[Rd] Possible bug: R --slave --interactive stdin echo on Linux when stdin is a fifo
luke-tier@ey m@ili@g off uiow@@edu