Index: code/branches/console/src/core/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/console/src/core/ArgumentCompletionFunctions.cc	(revision 1402)
+++ code/branches/console/src/core/ArgumentCompletionFunctions.cc	(revision 1416)
@@ -35,9 +35,7 @@
     namespace autocompletion
     {
-        const std::list<std::pair<std::string, std::string> >& fallback()
+        std::list<std::pair<std::string, std::string> > fallback()
         {
-std::cout << "5_1\n";
-            static std::list<std::pair<std::string, std::string> > list;
-std::cout << "5_2\n";
+            static std::list<std::pair<std::string, std::string> > list(1, std::pair<std::string, std::string>("muh", "MUH"));
             return list;
         }
Index: code/branches/console/src/core/ArgumentCompletionFunctions.h
===================================================================
--- code/branches/console/src/core/ArgumentCompletionFunctions.h	(revision 1402)
+++ code/branches/console/src/core/ArgumentCompletionFunctions.h	(revision 1416)
@@ -37,5 +37,5 @@
     namespace autocompletion
     {
-        const std::list<std::pair<std::string, std::string> >& fallback();
+        std::list<std::pair<std::string, std::string> > fallback();
     }
 }
Index: code/branches/console/src/core/CommandEvaluation.cc
===================================================================
--- code/branches/console/src/core/CommandEvaluation.cc	(revision 1402)
+++ code/branches/console/src/core/CommandEvaluation.cc	(revision 1416)
@@ -53,4 +53,5 @@
         this->listOfPossibleIdentifiers_.clear();
         this->listOfPossibleFunctions_.clear();
+        this->listOfPossibleArguments_.clear();
 
         this->functionclass_ = 0;
@@ -114,5 +115,10 @@
 std::cout << "complete: function != 0" << std::endl;
                     if (this->commandTokens_.size() > 1)
-                        return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size() - 1).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    {
+                        if ((this->commandTokens_.size() - 1) >= this->function_->getParamCount())
+                            return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join());
+                        else
+                            return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    }
                     else
                         return (this->function_->getName() + " ");
@@ -125,5 +131,5 @@
 std::cout << "complete: function != 0" << std::endl;
                     if (this->commandTokens_.size() > 1)
-                        return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size() - 1).join());
+                        return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join());
                     else
                         return (this->function_->getName());
@@ -144,5 +150,10 @@
 std::cout << "complete: function und functionclass != 0" << std::endl;
                     if (this->commandTokens_.size() > 2)
-                        return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    {
+                        if ((this->commandTokens_.size() - 2) >= this->function_->getParamCount())
+                            return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join());
+                        else
+                            return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    }
                     else
                         return (this->functionclass_->getName() + " " + this->function_->getName() + " ");
Index: code/branches/console/src/core/CommandExecutor.cc
===================================================================
--- code/branches/console/src/core/CommandExecutor.cc	(revision 1402)
+++ code/branches/console/src/core/CommandExecutor.cc	(revision 1416)
@@ -108,4 +108,10 @@
     {
         CommandExecutor::parseIfNeeded(command);
+
+        if (!CommandExecutor::getEvaluation().isNewCommand())
+            CommandExecutor::parse(CommandExecutor::getEvaluation().getCommand(), false);
+        else
+            CommandExecutor::getEvaluation().setNewCommand(false);
+
         return CommandExecutor::getEvaluation().complete();
     }
@@ -119,5 +125,5 @@
     CommandEvaluation CommandExecutor::evaluate(const std::string& command)
     {
-        CommandExecutor::parse(command, true);
+        CommandExecutor::parse(command);
         CommandExecutor::getEvaluation().evaluateParams();
         return CommandExecutor::getEvaluation();
@@ -126,11 +132,6 @@
     void CommandExecutor::parseIfNeeded(const std::string& command)
     {
-        if ((CommandExecutor::getEvaluation().getCommand() != command) || (CommandExecutor::getEvaluation().getState() == CS_Uninitialized))
+        if ((CommandExecutor::getEvaluation().getOriginalCommand() != command) || (CommandExecutor::getEvaluation().getState() == CS_Uninitialized))
             CommandExecutor::parse(command);
-        else if (!CommandExecutor::getEvaluation().isValid())
-        {
-            CommandExecutor::getEvaluation().setNewCommand(false);
-            CommandExecutor::parse(command, false);
-        }
     }
 
@@ -301,5 +302,4 @@
                 if (CommandExecutor::getEvaluation().getFunction())
                 {
-std::cout << "1\n";
                     unsigned int startindex = 0;
                     if (CommandExecutor::getEvaluation().getState() == CS_Shortcut_Params)
@@ -307,12 +307,9 @@
                     else if (CommandExecutor::getEvaluation().getState() == CS_Function_Params)
                         startindex = 2;
-std::cout << "2\n";
 
                     if (CommandExecutor::argumentsGiven() >= startindex)
                     {
-std::cout << "3\n";
-                        if (CommandExecutor::enoughArgumentsGiven(CommandExecutor::getEvaluation().getFunction()))
-                        {
-std::cout << "4\n";
+                        if ((CommandExecutor::argumentsGiven() == CommandExecutor::argumentsFinished() || !CommandExecutor::getEvaluation().isNewCommand()) && CommandExecutor::enoughArgumentsGiven(CommandExecutor::getEvaluation().getFunction()))
+                        {
                             if (CommandExecutor::getEvaluation().getState() == CS_Shortcut_Params)
                                 CommandExecutor::getEvaluation().setState(CS_Shortcut_Finished);
@@ -324,40 +321,31 @@
                         else
                         {
-std::cout << "5\n";
-std::cout << "last argument: " << CommandExecutor::getLastArgument() << std::endl;
-std::cout << "function: " << CommandExecutor::getEvaluation().getFunction() << std::endl;
-std::cout << "functionname: " << CommandExecutor::getEvaluation().getFunction()->getName() << std::endl;
-std::cout << "param nr: " << CommandExecutor::getEvaluation().getTokens().size() - startindex << std::endl;
                             CommandExecutor::createListOfPossibleArguments(CommandExecutor::getLastArgument(), CommandExecutor::getEvaluation().getFunction(), CommandExecutor::getEvaluation().getTokens().size() - startindex);
-std::cout << "6\n";
                             unsigned int numArguments = CommandExecutor::getEvaluation().getListOfPossibleArguments().size();
 
                             if (numArguments == 1)
                             {
-std::cout << "7\n";
                                 // There is exactly one possible argument
                                 const std::string* possibleArgument = (*CommandExecutor::getEvaluation().getListOfPossibleArguments().begin()).second;
-                                CommandExecutor::parse(CommandExecutor::getEvaluation().getTokens().subSet(0, CommandExecutor::getEvaluation().getTokens().size() - 1 - startindex).join() + " " + (*possibleArgument) + " ");
+                                if (CommandExecutor::argumentsGiven() > CommandExecutor::argumentsFinished())
+                                    CommandExecutor::parse(CommandExecutor::getEvaluation().getTokens().subSet(0, CommandExecutor::getEvaluation().getTokens().size() - 1).join() + " " + (*possibleArgument) + " ", false);
+                                else
+                                    CommandExecutor::parse(CommandExecutor::getEvaluation().getTokens().subSet(0, CommandExecutor::getEvaluation().getTokens().size()).join() + " " + (*possibleArgument) + " ", false);
+
                                 return;
                             }
 
-std::cout << "8\n";
                             if ((CommandExecutor::argumentsGiven() > CommandExecutor::argumentsFinished()) && (!CommandExecutor::getEvaluation().isNewCommand()))
                             {
-std::cout << "9\n";
                                 // There is more than one argument, but the user wants to use this - check if there is a perfect match
                                 const std::string* possibleArgument = CommandExecutor::getPossibleArgument(CommandExecutor::getLastArgument(), CommandExecutor::getEvaluation().getFunction(), CommandExecutor::getEvaluation().getTokens().size() - startindex);
                                 if (possibleArgument)
                                 {
-std::cout << "10\n";
                                     // There is such an argument - use it
                                     CommandExecutor::parse(command + " ", false);
                                     return;
                                 }
-std::cout << "11\n";
                             }
-std::cout << "12\n";
-                        }
-std::cout << "13\n";
+                        }
 
                         // Nothing to do
@@ -426,4 +414,5 @@
     void CommandExecutor::createListOfPossibleIdentifiers(const std::string& fragment)
     {
+        CommandExecutor::getEvaluation().getListOfPossibleIdentifiers().clear();
         std::string lowercase = getLowercase(fragment);
         for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseIdentifierMapBegin(); it != Identifier::getLowercaseIdentifierMapEnd(); ++it)
@@ -437,4 +426,5 @@
     void CommandExecutor::createListOfPossibleFunctions(const std::string& fragment, Identifier* identifier)
     {
+        CommandExecutor::getEvaluation().getListOfPossibleFunctions().clear();
         std::string lowercase = getLowercase(fragment);
         if (!identifier)
@@ -456,21 +446,11 @@
     void CommandExecutor::createListOfPossibleArguments(const std::string& fragment, ConsoleCommand* command, unsigned int param)
     {
-std::cout << "2_1\n";
+        CommandExecutor::getEvaluation().getListOfPossibleArguments().clear();
         std::string lowercase = getLowercase(fragment);
-std::cout << "2_2\n";
         for (std::list<std::pair<std::string, std::string> >::const_iterator it = command->getArgumentCompletionListBegin(param); it != command->getArgumentCompletionListEnd(param); ++it)
-        {
-std::cout << "2_3\n";
             if ((*it).first.find(lowercase) == 0 || fragment == "")
-            {
-std::cout << "2_4\n";
                 CommandExecutor::getEvaluation().getListOfPossibleArguments().push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second));
-std::cout << "2_5\n";
-            }
-        }
-
-std::cout << "2_6\n";
+
         CommandExecutor::getEvaluation().getListOfPossibleArguments().sort(CommandExecutor::compareStringsInList);
-std::cout << "2_7\n";
     }
 
Index: code/branches/console/src/core/ConsoleCommand.cc
===================================================================
--- code/branches/console/src/core/ConsoleCommand.cc	(revision 1402)
+++ code/branches/console/src/core/ConsoleCommand.cc	(revision 1416)
@@ -41,5 +41,5 @@
     }
 
-    ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, const std::list<std::pair<std::string, std::string> >& (*function) (void))
+    ConsoleCommand& ConsoleCommand::setArgumentCompletionList(unsigned int param, std::list<std::pair<std::string, std::string> > (*function) (void))
     {
         if (param < 5)
@@ -52,40 +52,32 @@
     }
 
-    const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param) const
+    const std::list<std::pair<std::string, std::string> >& ConsoleCommand::getArgumentCompletionList(unsigned int param)
     {
         if (param < 5)
-            return (*this->autocompletionFunction_[param])();
+            this->argumentList_ = (*this->autocompletionFunction_[param])();
         else
-            return autocompletion::fallback();
+            this->argumentList_ = autocompletion::fallback();
+
+        return this->argumentList_;
     }
 
-    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param) const
+    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListBegin(unsigned int param)
     {
-std::cout << "3_1: param: " << param << "\n";
         if (param < 5)
-        {
-std::cout << "3_2: >" << this->autocompletionFunction_[param] << "<\n";
-            return (*this->autocompletionFunction_[param])().begin();
-        }
+            this->argumentList_ = (*this->autocompletionFunction_[param])();
         else
-        {
-std::cout << "3_3\n";
-            return autocompletion::fallback().begin();
-        }
+            this->argumentList_ = autocompletion::fallback();
+
+        return this->argumentList_.begin();
     }
 
-    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param) const
+    std::list<std::pair<std::string, std::string> >::const_iterator ConsoleCommand::getArgumentCompletionListEnd(unsigned int param)
     {
-std::cout << "4_1: param: " << param << "\n";
         if (param < 5)
-        {
-std::cout << "4_2: >" << this->autocompletionFunction_[param] << "<\n";
-            return (*this->autocompletionFunction_[param])().end();
-        }
+            this->argumentList_ = (*this->autocompletionFunction_[param])();
         else
-        {
-std::cout << "4_3\n";
-            return autocompletion::fallback().end();
-        }
+            this->argumentList_ = autocompletion::fallback();
+
+        return this->argumentList_.end();
     }
 }
Index: code/branches/console/src/core/ConsoleCommand.h
===================================================================
--- code/branches/console/src/core/ConsoleCommand.h	(revision 1402)
+++ code/branches/console/src/core/ConsoleCommand.h	(revision 1416)
@@ -42,6 +42,6 @@
     SetConsoleCommandGeneric(classname##function##consolecommand__, classname, orxonox::createConsoleCommand(orxonox::createFunctor(&classname::function), #function), bCreateShortcut)
 
-#define SetConsoleCommandGeneric(fakevariable, classname, executor, bCreateShortcut) \
-    Executor& fakevariable = ClassManager<classname>::getIdentifier()->addConsoleCommand((ConsoleCommand*)executor, bCreateShortcut)
+#define SetConsoleCommandGeneric(fakevariable, classname, command, bCreateShortcut) \
+    ConsoleCommand& fakevariable = ClassManager<classname>::getIdentifier()->addConsoleCommand((ConsoleCommand*)command, bCreateShortcut)
 
 
@@ -52,6 +52,6 @@
     SetConsoleCommandShortcutGeneric(function##consolecommand__, orxonox::createConsoleCommand(orxonox::createFunctor(&function), #function))
 
-#define SetConsoleCommandShortcutGeneric(fakevariable, executor) \
-    Executor& fakevariable = CommandExecutor::addConsoleCommandShortcut((ConsoleCommand*)executor)
+#define SetConsoleCommandShortcutGeneric(fakevariable, command) \
+    ConsoleCommand& fakevariable = CommandExecutor::addConsoleCommandShortcut((ConsoleCommand*)command)
 
 
@@ -100,13 +100,14 @@
                 { return this->accessLevel_; }
 
-            ConsoleCommand& setArgumentCompletionList(unsigned int param, const std::list<std::pair<std::string, std::string> >& (*function) (void));
+            ConsoleCommand& setArgumentCompletionList(unsigned int param, std::list<std::pair<std::string, std::string> > (*function) (void));
 
-            const std::list<std::pair<std::string, std::string> >& getArgumentCompletionList(unsigned int param) const;
-            std::list<std::pair<std::string, std::string> >::const_iterator getArgumentCompletionListBegin(unsigned int param) const;
-            std::list<std::pair<std::string, std::string> >::const_iterator getArgumentCompletionListEnd(unsigned int param) const;
+            const std::list<std::pair<std::string, std::string> >& getArgumentCompletionList(unsigned int param);
+            std::list<std::pair<std::string, std::string> >::const_iterator getArgumentCompletionListBegin(unsigned int param);
+            std::list<std::pair<std::string, std::string> >::const_iterator getArgumentCompletionListEnd(unsigned int param);
 
         private:
             AccessLevel::Level accessLevel_;
-            const std::list<std::pair<std::string, std::string> >& (*autocompletionFunction_[5]) (void);
+            std::list<std::pair<std::string, std::string> > (*autocompletionFunction_[5]) (void);
+            std::list<std::pair<std::string, std::string> > argumentList_;
     };
 
Index: code/branches/console/src/core/Debug.h
===================================================================
--- code/branches/console/src/core/Debug.h	(revision 1402)
+++ code/branches/console/src/core/Debug.h	(revision 1416)
@@ -206,4 +206,13 @@
    COUT ## x
 
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define COUT0  \
+    if (getSoftDebugLevel() >= ORX_NONE)  \
+     COUT_EXEC(0)
+  #else
+   #define COUT0 if (ORX_NONE)\
+    COUT_EXEC(0)
+  #endif
+
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    #define COUT1  \
@@ -256,6 +265,4 @@
  #endif /* if ORX_PRINT_DEBUG_OUTPUT */
 
- #define COUT0 \
-  COUT_EXEC(0)
 #endif /* ifndef COUT */
 
@@ -274,4 +281,13 @@
    CCOUT ## x
 
+  #if ORX_HARD_DEBUG_LEVEL >= ORX_NONE
+   #define CCOUT0  \
+    if (getSoftDebugLevel() >= ORX_NONE)  \
+     CCOUT_EXEC(0)
+  #else
+   #define CCOUT0 if (ORX_NONE)\
+    CCOUT_EXEC(0)
+  #endif
+
   #if ORX_HARD_DEBUG_LEVEL >= ORX_ERROR
    #define CCOUT1  \
@@ -324,6 +340,4 @@
  #endif /* if ORX_PRINT_DEBUG_OUTPUT */
 
- #define CCOUT0 \
-  CCOUT_EXEC(0)
 #endif /* ifndef CCOUT */
 
Index: code/branches/console/src/core/OutputHandler.cc
===================================================================
--- code/branches/console/src/core/OutputHandler.cc	(revision 1402)
+++ code/branches/console/src/core/OutputHandler.cc	(revision 1416)
@@ -38,9 +38,9 @@
 namespace orxonox
 {
-    SetConsoleCommandShortcutGeneric(log,     createExecutor(createFunctor(&OutputHandler::log),     "log"    ));
-    SetConsoleCommandShortcutGeneric(error,   createExecutor(createFunctor(&OutputHandler::error),   "error"  ));
-    SetConsoleCommandShortcutGeneric(warning, createExecutor(createFunctor(&OutputHandler::warning), "warning"));
-    SetConsoleCommandShortcutGeneric(info,    createExecutor(createFunctor(&OutputHandler::info),    "info"   ));
-    SetConsoleCommandShortcutGeneric(debug,   createExecutor(createFunctor(&OutputHandler::debug),   "debug"  ));
+    SetConsoleCommandShortcutGeneric(log,     createConsoleCommand(createFunctor(&OutputHandler::log),     "log"    ));
+    SetConsoleCommandShortcutGeneric(error,   createConsoleCommand(createFunctor(&OutputHandler::error),   "error"  ));
+    SetConsoleCommandShortcutGeneric(warning, createConsoleCommand(createFunctor(&OutputHandler::warning), "warning"));
+    SetConsoleCommandShortcutGeneric(info,    createConsoleCommand(createFunctor(&OutputHandler::info),    "info"   ));
+    SetConsoleCommandShortcutGeneric(debug,   createConsoleCommand(createFunctor(&OutputHandler::debug),   "debug"  ));
 
     /**
Index: code/branches/console/src/core/TclBind.cc
===================================================================
--- code/branches/console/src/core/TclBind.cc	(revision 1402)
+++ code/branches/console/src/core/TclBind.cc	(revision 1416)
@@ -39,6 +39,6 @@
 namespace orxonox
 {
-    SetConsoleCommandShortcutGeneric(tcl, createExecutor(createFunctor(&TclBind::tcl), "tcl"));
-    SetConsoleCommandShortcutGeneric(bgerror, createExecutor(createFunctor(&TclBind::bgerror), "bgerror"));
+    SetConsoleCommandShortcutGeneric(tcl, createConsoleCommand(createFunctor(&TclBind::tcl), "tcl"));
+    SetConsoleCommandShortcutGeneric(bgerror, createConsoleCommand(createFunctor(&TclBind::bgerror), "bgerror"));
 
     TclBind::TclBind()
Index: code/branches/console/src/core/TclThreadManager.cc
===================================================================
--- code/branches/console/src/core/TclThreadManager.cc	(revision 1402)
+++ code/branches/console/src/core/TclThreadManager.cc	(revision 1416)
@@ -48,6 +48,6 @@
 namespace orxonox
 {
-    SetConsoleCommandShortcutGeneric(tclexecute, createExecutor(createFunctor(&TclThreadManager::execute), "tclexecute"));
-    SetConsoleCommandShortcutGeneric(tclquery,   createExecutor(createFunctor(&TclThreadManager::query),   "tclquery"  ));
+    SetConsoleCommandShortcutGeneric(tclexecute, createConsoleCommand(createFunctor(&TclThreadManager::execute), "tclexecute"));
+    SetConsoleCommandShortcutGeneric(tclquery,   createConsoleCommand(createFunctor(&TclThreadManager::query),   "tclquery"  ));
     SetConsoleCommand(TclThreadManager, create,  false);
     SetConsoleCommand(TclThreadManager, destroy, false);
Index: code/branches/console/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/console/src/orxonox/GraphicsEngine.cc	(revision 1402)
+++ code/branches/console/src/orxonox/GraphicsEngine.cc	(revision 1416)
@@ -45,5 +45,5 @@
 #include "core/Debug.h"
 #include "core/TclBind.h"
-
+#include "console/InGameConsole.h"
 
 namespace orxonox {
@@ -304,4 +304,5 @@
         int h = rw->getHeight();
         InputManager::getSingleton().setWindowExtents(w, h);
+        InGameConsole::getInstance().resize();
     }
 
Index: code/branches/console/src/orxonox/console/InGameConsole.cc
===================================================================
--- code/branches/console/src/orxonox/console/InGameConsole.cc	(revision 1402)
+++ code/branches/console/src/orxonox/console/InGameConsole.cc	(revision 1416)
@@ -43,7 +43,10 @@
 #include "core/ConsoleCommand.h"
 #include "core/InputManager.h"
+#include "util/Math.h"
+
 #include "GraphicsEngine.h"
 
 #define LINES 30
+#define CHAR_WIDTH 7.85 // fix this please - determine the char-width dynamically
 
 namespace orxonox
@@ -68,4 +71,6 @@
         this->cursor_ = 0.0;
         this->cursorSymbol_ = '|';
+        this->inputWindowStart_ = 0;
+        this->numLinesShifted_ = LINES - 1;
 
         this->init();
@@ -111,15 +116,23 @@
     {
         std::list<std::string>::const_iterator it = Shell::getInstance().getNewestLineIterator();
-        for (int i = 1; i < LINES; i++)
+        int max = 0;
+        for (int i = 1; i < LINES; ++i)
         {
             if (it != Shell::getInstance().getEndIterator())
             {
-                this->print(*it, i);
                 ++it;
+                max = i;
             }
             else
-            {
-                this->print("", i);
-            }
+                break;
+        }
+
+        for (int i = LINES - 1; i > max; --i)
+            this->print("", i, true);
+
+        for (int i = max; i >= 1; --i)
+        {
+            --it;
+            this->print(*it, i, true);
         }
     }
@@ -139,11 +152,6 @@
     void InGameConsole::lineAdded()
     {
-        for (unsigned int i = LINES - 1; i > 1; --i)
-        {
-            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
-            this->consoleOverlayTextAreas_[i]->setColourTop(this->consoleOverlayTextAreas_[i - 1]->getColourTop());
-            this->consoleOverlayTextAreas_[i]->setColourBottom(this->consoleOverlayTextAreas_[i - 1]->getColourBottom());
-        }
-
+        this->numLinesShifted_ = 0;
+        this->shiftLines();
         this->onlyLastLineChanged();
     }
@@ -156,4 +164,7 @@
         if (LINES > 0)
             this->print(Shell::getInstance().getInput(), 0);
+
+        if (Shell::getInstance().getInput() == "" || Shell::getInstance().getInput().size() == 0)
+            this->inputWindowStart_ = 0;
     }
 
@@ -246,4 +257,33 @@
 
         COUT(4) << "Info: InGameConsole initialized" << std::endl;
+    }
+
+    /**
+        @brief Resizes the console elements. Call if window size changes.
+    */
+    void InGameConsole::resize()
+    {
+        this->windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
+        this->windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
+        this->consoleOverlayBorder_->setWidth((int) this->windowW_* InGameConsole::REL_WIDTH);
+        this->consoleOverlayBorder_->setHeight((int) this->windowH_ * InGameConsole::REL_HEIGHT);
+        this->consoleOverlayNoise_->setWidth((int) this->windowW_ * InGameConsole::REL_WIDTH - 10);
+        this->consoleOverlayNoise_->setHeight((int) this->windowH_ * InGameConsole::REL_HEIGHT - 5);
+
+        // now adjust the text lines...
+        this->desiredTextWidth_ = (int) (this->windowW_ * InGameConsole::REL_WIDTH) - 12;
+
+        if (LINES > 0)
+            this->maxCharsPerLine_ = max((unsigned int)10, (unsigned int) ((float)this->desiredTextWidth_ / CHAR_WIDTH));
+        else
+            this->maxCharsPerLine_ = 10;
+
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i]->setWidth(this->desiredTextWidth_);
+            this->consoleOverlayTextAreas_[i]->setTop((int) this->windowH_ * InGameConsole::REL_HEIGHT - 24 - 14*i);
+        }
+
+        this->linesChanged();
     }
 
@@ -301,23 +341,4 @@
 
     /**
-        @brief Resizes the console elements. Call if window size changes.
-    */
-    void InGameConsole::resize()
-    {
-        this->windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
-        this->windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
-        this->consoleOverlayBorder_->setWidth((int) this->windowW_* InGameConsole::REL_WIDTH);
-        this->consoleOverlayBorder_->setHeight((int) this->windowH_ * InGameConsole::REL_HEIGHT);
-        this->consoleOverlayNoise_->setWidth((int) this->windowW_ * InGameConsole::REL_WIDTH - 10);
-        this->consoleOverlayNoise_->setHeight((int) this->windowH_ * InGameConsole::REL_HEIGHT - 5);
-        // now adjust the text lines...
-        for (int i = 0; i < LINES; i++)
-        {
-            this->consoleOverlayTextAreas_[i]->setWidth((int) this->windowW_ * InGameConsole::REL_WIDTH);
-            this->consoleOverlayTextAreas_[i]->setTop((int) this->windowH_ * InGameConsole::REL_HEIGHT - 24 - 14*i);
-        }
-    }
-
-    /**
         @brief Shows the InGameConsole.
     */
@@ -362,8 +383,60 @@
 
     /**
+        @brief Shifts all output lines one line up
+    */
+    void InGameConsole::shiftLines()
+    {
+        for (unsigned int i = LINES - 1; i > 1; --i)
+        {
+            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
+            this->consoleOverlayTextAreas_[i]->setColourTop(this->consoleOverlayTextAreas_[i - 1]->getColourTop());
+            this->consoleOverlayTextAreas_[i]->setColourBottom(this->consoleOverlayTextAreas_[i - 1]->getColourBottom());
+        }
+    }
+
+    void InGameConsole::colourLine(int colourcode, int index)
+    {
+        if (colourcode == -1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
+        }
+        else if (colourcode == 1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
+        }
+        else if (colourcode == 2)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
+        }
+        else if (colourcode == 3)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
+        }
+        else if (colourcode == 4)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
+        }
+        else if (colourcode == 5)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+        }
+        else
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
+        }
+    }
+
+    /**
         @brief Prints string to bottom line.
         @param s String to be printed
     */
-    void InGameConsole::print(const std::string& text, int index)
+    void InGameConsole::print(const std::string& text, int index, bool alwaysShift)
     {
         char level = 0;
@@ -378,41 +451,35 @@
         if (LINES > index)
         {
-            if (level == -1)
+            this->colourLine(level, index);
+
+            if (index > 0)
             {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
-            }
-            else if (level == 1)
-            {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
-            }
-            else if (level == 2)
-            {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
-            }
-            else if (level == 3)
-            {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
-            }
-            else if (level == 4)
-            {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
-            }
-            else if (level == 5)
-            {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+                unsigned int linesUsed = 1;
+                while (output.size() > this->maxCharsPerLine_)
+                {
+                    ++linesUsed;
+                    this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output.substr(0, this->maxCharsPerLine_)));
+                    output.erase(0, this->maxCharsPerLine_);
+                    output.insert(0, 1, ' ');
+                    if (linesUsed > numLinesShifted_ || alwaysShift)
+                        this->shiftLines();
+                    this->colourLine(level, index);
+                }
+                this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
+                this->numLinesShifted_ = linesUsed;
             }
             else
             {
-                this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
-                this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
+                if (output.size() > this->maxCharsPerLine_)
+                {
+                    if (Shell::getInstance().getInputBuffer().getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer().getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer().getCursorPosition() - this->maxCharsPerLine_ + 1;
+
+                    output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
+                }
+                this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
             }
-
-            this->consoleOverlayTextAreas_[index]->setCaption(convert2UTF(output));
         }
     }
Index: code/branches/console/src/orxonox/console/InGameConsole.h
===================================================================
--- code/branches/console/src/orxonox/console/InGameConsole.h	(revision 1402)
+++ code/branches/console/src/orxonox/console/InGameConsole.h	(revision 1416)
@@ -48,16 +48,9 @@
 
             void setConfigValues();
-
-            virtual void linesChanged();
-            virtual void onlyLastLineChanged();
-            virtual void lineAdded();
-            virtual void inputChanged();
-            virtual void cursorChanged();
-            virtual void exit();
-
             void tick(float dt);
 
             void activate();
             void deactivate();
+            void resize();
 
             static void openConsole();
@@ -69,7 +62,15 @@
             ~InGameConsole();
 
+            virtual void linesChanged();
+            virtual void onlyLastLineChanged();
+            virtual void lineAdded();
+            virtual void inputChanged();
+            virtual void cursorChanged();
+            virtual void exit();
+
             void init();
-            void resize();
-            void print(const std::string& text, int index);
+            void shiftLines();
+            void colourLine(int colourcode, int index);
+            void print(const std::string& text, int index, bool alwaysShift = false);
             static Ogre::UTFString convert2UTF(std::string s);
 
@@ -80,7 +81,11 @@
             int windowW_;
             int windowH_;
+            int desiredTextWidth_;
+            unsigned int maxCharsPerLine_;
+            unsigned int numLinesShifted_;
             int scroll_;
             float scrollTimer_;
             float cursor_;
+            unsigned int inputWindowStart_;
             char cursorSymbol_;
             bool active_;
