diff -r 27bd1032a5c6 -r 01a04ffaf85f src/main/java/org/vaadin/console/client/ui/TextConsole.java --- a/src/main/java/org/vaadin/console/client/ui/TextConsole.java Tue May 17 18:50:45 2011 +0400 +++ b/src/main/java/org/vaadin/console/client/ui/TextConsole.java Wed May 18 00:43:34 2011 +0400 @@ -262,19 +262,26 @@ } protected void carriageReturn() { - setPromtActive(false); - // Append newline first if not there yet - if (!bufferIsEmpty() && !bufferEndsWithNewLine()) { - newLine(); - reducePrompt(-1); - } - if (config.isPrintPromptOnInput()) { + if (config.isPrintPromptOnInput()) { + setPromtActive(false); + // Append newline first if not there yet + if (!bufferIsEmpty() && !bufferEndsWithNewLine()) { + newLine(); + reducePrompt(-1); + } print(getCurrentPromptContent()); newLine(); - } - if (promptRows > 1) { - reducePrompt(-1); - } + if (promptRows > 1) { + reducePrompt(-1); + } + } else { + if (!bufferIsEmpty() && !bufferEndsWithNewLine()) { + newLine(); + if (promptRows > 1) { + reducePrompt(-1); + } + } + } String lineBuffer = getInput(); lineBuffer = lineBuffer.trim(); if (!"".equals(lineBuffer)) { @@ -457,11 +464,12 @@ setInput(inputText); } - public void focusInput(){ - setPromtActive(true); - scrollToEnd(); - ps.setInnerHTML(cleanPs); - } + public void focusInput() { + if (isFocused()) + setPromtActive(true); + scrollToEnd(); + ps.setInnerHTML(cleanPs); + } public void scrollToEnd() { term.setScrollTop(BIG_NUMBER);