From ripley at stats.ox.ac.uk  Tue Dec 11 16:27:54 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 11 Dec 2007 15:27:54 +0000 (GMT)
Subject: [Rd] Interactiveness
In-Reply-To: <475EA1FB.8010002@Update.UU.SE>
References: <475EA1FB.8010002@Update.UU.SE>
Message-ID: <Pine.LNX.4.64.0712111454180.7824@auk.stats>

On Tue, 11 Dec 2007, Bjarni Juliusson wrote:

> Hi list!
>
> I'm developing R integration for a project called Bioclipse at Uppsala
> University. The current implementation works by simply forking an R and
> sending it text (with some substitutions on it) down a pipe, getting the
> printed output back up another pipe. This of course works fine, except
> it runs into one problem: R finds a pipe on its stdin and decides to be
> "non-interactive", which means that as soon as the user makes a typo and
> causes an error, R exits.

Actually, not so.  The default error handler for non-interactive use is to 
do that, but you can change it.

> I checked the source, and it's a couple of isatty()'s in the two files
> named system.c that are doing it. They are of course intended to be a
> feature, but in this case it causes us trouble. Would it be possible to
> get a command line switch to control this behaviour? I'm not sure pseudo
> terminals can be used portably, or can they?

They can, and are e.g. by ESS (except on Windows, where there is already a 
switch).  I think you need to look a bit more carefully at what other 
projects do.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Interactiveness
Prof Brian Ripley