diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java b/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java index cfacba3a4e7..9a2eabd267f 100644 --- a/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java +++ b/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java @@ -320,22 +320,14 @@ private void addToHistory(String command) if (command == null) return; - String[] lines = command.split("\n"); - for (String line : lines) + if (history_.size() > 0 + && command.equals(history_.get(history_.size() - 1))) { - // do not allow empty lines - if (line.length() == 0) - return; - - if (history_.size() > 0 - && line.equals(history_.get(history_.size() - 1))) - { - // do not allow dupes - return; - } - - history_.add(line); + // do not allow dupes + return; } + + history_.add(command); } public void onSendToConsole(SendToConsoleEvent event)