Skip to content
Browse files

correctly handle multiline console input in presentation log

  • Loading branch information...
1 parent ff7c87a commit 6c89fad3a83260fbf2482be8d44bdc7ffaf40565 @jjallaire jjallaire committed Mar 29, 2013
View
3 src/cpp/r/include/r/session/RSessionUtils.hpp
@@ -30,6 +30,8 @@ namespace utils {
// check for R 3.0
bool isR3();
+bool isDefaultPrompt(const std::string& prompt);
+
// user home path
const core::FilePath& userHomePath();
@@ -39,6 +41,7 @@ core::FilePath tempFile(const std::string& prefix,
const std::string& extension);
core::FilePath tempDir();
+
// suppress output in scope
class SuppressOutputInScope
View
5 src/cpp/r/session/RSession.cpp
@@ -1594,6 +1594,11 @@ bool isR3()
return s_isR3;
}
+bool isDefaultPrompt(const std::string& prompt)
+{
+ return prompt == r::options::getOption<std::string>("prompt");
+}
+
const FilePath& userHomePath()
{
return s_options.userHomePath;
View
5 src/cpp/session/modules/presentation/PresentationLog.cpp
@@ -30,6 +30,7 @@
#include <r/RSexp.hpp>
#include <r/RExec.hpp>
+#include <r/session/RSessionUtils.hpp>
#include "PresentationState.hpp"
@@ -109,6 +110,10 @@ void Log::onConsolePrompt(const std::string& prompt)
if (!presentation::state::isActive())
return;
+ // ignore if this isn't the default prompt
+ if (!r::session::utils::isDefaultPrompt(prompt))
+ return;
+
if (!consoleInputBuffer_.empty())
{
std::string input = boost::algorithm::trim_copy(

0 comments on commit 6c89fad

Please sign in to comment.
Something went wrong with that request. Please try again.