Index: code/branches/console/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.cc	(revision 6007)
+++ code/branches/console/src/libraries/core/IOConsole.cc	(revision 6010)
@@ -50,5 +50,4 @@
 {
     IOConsole* IOConsole::singletonPtr_s = NULL;
-    const std::string promptString_g = "orxonox>";
 
 #ifdef ORXONOX_PLATFORM_UNIX
@@ -65,8 +64,9 @@
 
     IOConsole::IOConsole()
-        : shell_(new Shell("IOConsole", false))
+        : shell_(new Shell("IOConsole", false, true))
         , buffer_(shell_->getInputBuffer())
         , originalTerminalSettings_(new termios())
         , bStatusPrinted_(false)
+        , promptString_("orxonox> ")
     {
         this->setTerminalMode();
@@ -143,7 +143,7 @@
                     this->buffer_->buttonPressed(KeyEvent(KeyCode::End,      0, 0));
                 else if (escapeSequence == "5~")
-                    this->buffer_->buttonPressed(KeyEvent(KeyCode::AltPageUp,   0, 0));
+                    this->buffer_->buttonPressed(KeyEvent(KeyCode::PageUp,   0, 0));
                 else if (escapeSequence == "6~")
-                    this->buffer_->buttonPressed(KeyEvent(KeyCode::AltPageDown, 0, 0));
+                    this->buffer_->buttonPressed(KeyEvent(KeyCode::PageDown, 0, 0));
                 else
                     // Waiting for sequence to complete
@@ -192,4 +192,5 @@
         this->printStatusLines();
         this->printInputLine();
+        std::cout.flush();
     }
 
@@ -227,5 +228,4 @@
         // Reset colour to white
 //        std::cout << "\033[37m";
-        std::cout.flush();
     }
 
@@ -244,5 +244,4 @@
         if (this->buffer_->getCursorPosition() > 0)
             std::cout << "\033[" << this->buffer_->getCursorPosition() << "C";
-        std::cout.flush();
     }
 
@@ -259,5 +258,4 @@
             }
             std::cout << "Status" << std::endl;
-            std::cout.flush();
             this->bStatusPrinted_ = true;
         }
@@ -332,4 +330,8 @@
     }
 
+    void IOConsole::printStatusLines()
+    {
+    }
+
 #endif /* ORXONOX_PLATFORM_UNIX */
 
@@ -378,4 +380,5 @@
         this->printStatusLines();
         this->printInputLine();
+        std::cout.flush();
     }
 
@@ -387,4 +390,5 @@
     {
         this->printInputLine();
+        std::cout.flush();
     }
 
@@ -396,4 +400,5 @@
     {
         this->printInputLine();
+        std::cout.flush();
     }
 
@@ -404,9 +409,5 @@
     void IOConsole::executed()
     {
-        // Move cursor the beginning of the line
-        std::cout << "\033[1G";
-        // Print command so the user knows what he has typed
-        std::cout << promptString_g << this->shell_->getInput() << std::endl;
-        this->printInputLine();
+        this->shell_->addOutputLine(this->promptString_ + this->shell_->getInput());
     }
 
Index: code/branches/console/src/libraries/core/IOConsole.h
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.h	(revision 6007)
+++ code/branches/console/src/libraries/core/IOConsole.h	(revision 6010)
@@ -77,4 +77,5 @@
         std::vector<unsigned>   statusLineWidths_;
         unsigned int            statusLineMaxWidth_;
+        const std::string       promptString_;
         static const unsigned   minOutputLines_ = 3;
 
Index: code/branches/console/src/libraries/core/Shell.cc
===================================================================
--- code/branches/console/src/libraries/core/Shell.cc	(revision 6007)
+++ code/branches/console/src/libraries/core/Shell.cc	(revision 6010)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Reto Grieder
  *
  */
@@ -44,8 +44,9 @@
     SetConsoleCommandShortcut(OutputHandler, debug);
 
-    Shell::Shell(const std::string& consoleName, bool bScrollable)
-        : inputBuffer_(new InputBuffer())
-        , OutputListener(consoleName)
+    Shell::Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel)
+        : OutputListener(consoleName)
+        , inputBuffer_(new InputBuffer())
         , consoleName_(consoleName)
+        , bPrependOutputLevel_(bPrependOutputLevel)
         , bScrollable_(bScrollable)
     {
@@ -56,8 +57,7 @@
         this->historyPosition_ = 0;
         this->historyOffset_ = 0;
-        this->finishedLastLine_ = true;
-        this->bAddOutputLevel_ = false;
-
-        this->clearLines();
+        this->bFinishedLastLine_ = true;
+
+        this->clearOutput();
         this->configureInputBuffer();
 
@@ -131,21 +131,27 @@
     {
         this->inputBuffer_->registerListener(this, &Shell::inputChanged, true);
-        this->inputBuffer_->registerListener(this, &Shell::execute, '\r', false);
-        this->inputBuffer_->registerListener(this, &Shell::execute, '\n', false);
-        this->inputBuffer_->registerListener(this, &Shell::hintandcomplete, '\t', true);
-        this->inputBuffer_->registerListener(this, &Shell::backspace, '\b', true);
-        this->inputBuffer_->registerListener(this, &Shell::backspace, '\177', true);
-        this->inputBuffer_->registerListener(this, &Shell::deletechar, KeyCode::Delete);
-        this->inputBuffer_->registerListener(this, &Shell::exit, '\033', true); // escape
-        this->inputBuffer_->registerListener(this, &Shell::cursor_right, KeyCode::Right);
-        this->inputBuffer_->registerListener(this, &Shell::cursor_left, KeyCode::Left);
-        this->inputBuffer_->registerListener(this, &Shell::cursor_end, KeyCode::End);
-        this->inputBuffer_->registerListener(this, &Shell::cursor_home, KeyCode::Home);
-        this->inputBuffer_->registerListener(this, &Shell::history_up, KeyCode::Up);
-        this->inputBuffer_->registerListener(this, &Shell::history_down, KeyCode::Down);
-        this->inputBuffer_->registerListener(this, &Shell::scroll_up, KeyCode::PageUp);
-        this->inputBuffer_->registerListener(this, &Shell::scroll_down, KeyCode::PageDown);
-        this->inputBuffer_->registerListener(this, &Shell::history_search_up, KeyCode::AltPageUp);
-        this->inputBuffer_->registerListener(this, &Shell::history_search_down, KeyCode::AltPageDown);
+        this->inputBuffer_->registerListener(this, &Shell::execute,         '\r',   false);
+        this->inputBuffer_->registerListener(this, &Shell::execute,         '\n',   false);
+        this->inputBuffer_->registerListener(this, &Shell::hintAndComplete, '\t',   true);
+        this->inputBuffer_->registerListener(this, &Shell::backspace,       '\b',   true);
+        this->inputBuffer_->registerListener(this, &Shell::backspace,       '\177', true);
+        this->inputBuffer_->registerListener(this, &Shell::exit,            '\033', true); // escape
+        this->inputBuffer_->registerListener(this, &Shell::deleteChar,      KeyCode::Delete);
+        this->inputBuffer_->registerListener(this, &Shell::cursorRight,     KeyCode::Right);
+        this->inputBuffer_->registerListener(this, &Shell::cursorLeft,      KeyCode::Left);
+        this->inputBuffer_->registerListener(this, &Shell::cursorEnd,       KeyCode::End);
+        this->inputBuffer_->registerListener(this, &Shell::cursorHome,      KeyCode::Home);
+        this->inputBuffer_->registerListener(this, &Shell::historyUp,       KeyCode::Up);
+        this->inputBuffer_->registerListener(this, &Shell::historyDown,     KeyCode::Down);
+        if (this->bScrollable_)
+        {
+            this->inputBuffer_->registerListener(this, &Shell::scrollUp,    KeyCode::PageUp);
+            this->inputBuffer_->registerListener(this, &Shell::scrollDown,  KeyCode::PageDown);
+        }
+        else
+        {
+            this->inputBuffer_->registerListener(this, &Shell::historySearchUp,   KeyCode::PageUp);
+            this->inputBuffer_->registerListener(this, &Shell::historySearchDown, KeyCode::PageDown);
+        }
     }
 
@@ -156,7 +162,7 @@
 
         for (unsigned int i = instance.historyOffset_; i < instance.commandHistory_.size(); ++i)
-            instance.addLine(instance.commandHistory_[i], -1);
+            instance.addOutputLine(instance.commandHistory_[i], -1);
         for (unsigned int i =  0; i < instance.historyOffset_; ++i)
-            instance.addLine(instance.commandHistory_[i], -1);
+            instance.addOutputLine(instance.commandHistory_[i], -1);
     }
     */
@@ -184,11 +190,5 @@
     }
 
-    void Shell::setInput(const std::string& input)
-    {
-        this->inputBuffer_->set(input);
-        this->inputChanged();
-    }
-
-    void Shell::addLine(const std::string& line, int level)
+    void Shell::addOutputLine(const std::string& line, int level)
     {
         if (level <= this->softDebugLevel_)
@@ -197,5 +197,5 @@
     }
 
-    void Shell::clearLines()
+    void Shell::clearOutput()
     {
         this->outputLines_.clear();
@@ -203,5 +203,5 @@
 
         this->scrollPosition_ = 0;
-        this->finishedLastLine_ = true;
+        this->bFinishedLastLine_ = true;
 
         this->updateListeners<&ShellListener::linesChanged>();
@@ -256,7 +256,7 @@
                 break;
 
-            if (this->finishedLastLine_)
+            if (this->bFinishedLastLine_)
             {
-                if (this->bAddOutputLevel_)
+                if (this->bPrependOutputLevel_)
                     output.insert(0, 1, static_cast<char>(level));
 
@@ -268,5 +268,5 @@
                     this->scrollIterator_ = this->outputLines_.begin();
 
-                this->finishedLastLine_ = newline;
+                this->bFinishedLastLine_ = newline;
 
                 if (!this->scrollPosition_)
@@ -278,5 +278,5 @@
             {
                 (*this->outputLines_.begin()) += output;
-                this->finishedLastLine_ = newline;
+                this->bFinishedLastLine_ = newline;
                 this->updateListeners<&ShellListener::onlyLastLineChanged>();
             }
@@ -285,43 +285,5 @@
     }
 
-    void Shell::inputChanged()
-    {
-        this->updateListeners<&ShellListener::inputChanged>();
-        this->updateListeners<&ShellListener::cursorChanged>();
-    }
-
-    void Shell::execute()
-    {
-        this->addToHistory(this->inputBuffer_->get());
-        this->updateListeners<&ShellListener::executed>();
-
-        if (!CommandExecutor::execute(this->inputBuffer_->get()))
-            this->addLine("Error: Can't execute \"" + this->inputBuffer_->get() + "\".", 1);
-
-        this->clear();
-    }
-
-    void Shell::hintandcomplete()
-    {
-        this->inputBuffer_->set(CommandExecutor::complete(this->inputBuffer_->get()));
-        this->addLine(CommandExecutor::hint(this->inputBuffer_->get()), -1);
-
-        this->inputChanged();
-    }
-
-    void Shell::backspace()
-    {
-        this->inputBuffer_->removeBehindCursor();
-        this->updateListeners<&ShellListener::inputChanged>();
-        this->updateListeners<&ShellListener::cursorChanged>();
-    }
-
-    void Shell::deletechar()
-    {
-        this->inputBuffer_->removeAtCursor();
-        this->updateListeners<&ShellListener::inputChanged>();
-    }
-
-    void Shell::clear()
+    void Shell::clearInput()
     {
         this->inputBuffer_->clear();
@@ -331,5 +293,67 @@
     }
 
-    void Shell::cursor_right()
+    void Shell::setPromptPrefix(const std::string& str)
+    {
+    }
+
+
+    // ##########################################
+    // ###   InputBuffer callback functions   ###
+    // ##########################################
+
+    void Shell::inputChanged()
+    {
+        this->updateListeners<&ShellListener::inputChanged>();
+        this->updateListeners<&ShellListener::cursorChanged>();
+    }
+
+    void Shell::execute()
+    {
+        this->addToHistory(this->inputBuffer_->get());
+        this->updateListeners<&ShellListener::executed>();
+
+        if (!CommandExecutor::execute(this->inputBuffer_->get()))
+            this->addOutputLine("Error: Can't execute \"" + this->inputBuffer_->get() + "\".", 1);
+
+        this->clearInput();
+    }
+
+    void Shell::hintAndComplete()
+    {
+        this->inputBuffer_->set(CommandExecutor::complete(this->inputBuffer_->get()));
+        this->addOutputLine(CommandExecutor::hint(this->inputBuffer_->get()), -1);
+
+        this->inputChanged();
+    }
+
+    void Shell::backspace()
+    {
+        this->inputBuffer_->removeBehindCursor();
+        this->updateListeners<&ShellListener::inputChanged>();
+        this->updateListeners<&ShellListener::cursorChanged>();
+    }
+
+    void Shell::exit()
+    {
+        if (this->inputBuffer_->getSize() > 0)
+        {
+            this->clearInput();
+            return;
+        }
+
+        this->clearInput();
+        this->scrollPosition_ = 0;
+        this->scrollIterator_ = this->outputLines_.begin();
+
+        this->updateListeners<&ShellListener::exit>();
+    }
+
+    void Shell::deleteChar()
+    {
+        this->inputBuffer_->removeAtCursor();
+        this->updateListeners<&ShellListener::inputChanged>();
+    }
+
+    void Shell::cursorRight()
     {
         this->inputBuffer_->increaseCursor();
@@ -337,5 +361,5 @@
     }
 
-    void Shell::cursor_left()
+    void Shell::cursorLeft()
     {
         this->inputBuffer_->decreaseCursor();
@@ -343,5 +367,5 @@
     }
 
-    void Shell::cursor_end()
+    void Shell::cursorEnd()
     {
         this->inputBuffer_->setCursorToEnd();
@@ -349,5 +373,5 @@
     }
 
-    void Shell::cursor_home()
+    void Shell::cursorHome()
     {
         this->inputBuffer_->setCursorToBegin();
@@ -355,5 +379,5 @@
     }
 
-    void Shell::history_up()
+    void Shell::historyUp()
     {
         if (this->historyPosition_ < this->commandHistory_.size())
@@ -364,5 +388,5 @@
     }
 
-    void Shell::history_down()
+    void Shell::historyDown()
     {
         if (this->historyPosition_ > 0)
@@ -373,10 +397,10 @@
     }
 
-    void Shell::history_search_up()
+    void Shell::historySearchUp()
     {
         if (this->historyPosition_ == this->historyOffset_)
             return;
         unsigned int cursorPosition = this->getCursorPosition();
-        std::string input_str(this->getInput().substr(0, cursorPosition)); // only search for the expression from the beginning of the inputline untill the cursor position
+        std::string input_str(this->getInput().substr(0, cursorPosition)); // only search for the expression from the beginning of the inputline until the cursor position
         for (unsigned int newPos = this->historyPosition_ + 1; newPos <= this->historyOffset_; newPos++)
         {
@@ -391,10 +415,10 @@
     }
 
-    void Shell::history_search_down()
+    void Shell::historySearchDown()
     {
         if (this->historyPosition_ == 0)
             return;
         unsigned int cursorPosition = this->getCursorPosition();
-        std::string input_str(this->getInput().substr(0, cursorPosition)); // only search for the expression from the beginn$
+        std::string input_str(this->getInput().substr(0, cursorPosition)); // only search for the expression from the beginning
         for (unsigned int newPos = this->historyPosition_ - 1; newPos > 0; newPos--)
         {
@@ -409,5 +433,5 @@
     }
 
-    void Shell::scroll_up()
+    void Shell::scrollUp()
     {
         if (this->scrollIterator_ != this->outputLines_.end())
@@ -420,5 +444,5 @@
     }
 
-    void Shell::scroll_down()
+    void Shell::scrollDown()
     {
         if (this->scrollIterator_ != this->outputLines_.begin())
@@ -430,18 +454,3 @@
         }
     }
-
-    void Shell::exit()
-    {
-        if (this->inputBuffer_->getSize() > 0)
-        {
-            this->clear();
-            return;
-        }
-
-        this->clear();
-        this->scrollPosition_ = 0;
-        this->scrollIterator_ = this->outputLines_.begin();
-
-        this->updateListeners<&ShellListener::exit>();
-    }
 }
Index: code/branches/console/src/libraries/core/Shell.h
===================================================================
--- code/branches/console/src/libraries/core/Shell.h	(revision 6007)
+++ code/branches/console/src/libraries/core/Shell.h	(revision 6010)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Reto Grieder
  *
  */
@@ -61,9 +61,10 @@
     };
 
+
     class _CoreExport Shell : virtual public OrxonoxClass, public OutputListener
     {
         public:
-            Shell(const std::string& consoleName, bool bScrollable);
-            virtual ~Shell();
+            Shell(const std::string& consoleName, bool bScrollable, bool bPrependOutputLevel = false);
+            ~Shell();
 
             void setConfigValues();
@@ -81,8 +82,4 @@
                 { return this->inputBuffer_->getCursorPosition(); }
 
-            void setInput(const std::string& input);
-
-            inline void clearInput()
-                { this->setInput(""); }
             inline std::string getInput() const
                 { return this->inputBuffer_->get(); }
@@ -91,6 +88,6 @@
             std::list<std::string>::const_iterator getEndIterator() const;
 
-            void addLine(const std::string& line, int level = 0);
-            void clearLines();
+            void addOutputLine(const std::string& line, int level = 0);
+            void clearOutput();
 
             inline unsigned int getNumLines() const
@@ -99,33 +96,34 @@
                 { return this->scrollPosition_; }
 
-            inline void addOutputLevel(bool bAddOutputLevel)
-                { this->bAddOutputLevel_ = bAddOutputLevel; }
+            inline const std::string& getPromptPrefix() const { return this->promptPrefix_; }
+            void setPromptPrefix(const std::string& str);
 
         private:
             Shell(const Shell& other);
 
+            void addToHistory(const std::string& command);
+            std::string getFromHistory() const;
+            void clearInput();
+            // OutputListener
+            void outputChanged(int level);
+
             void configureInputBuffer();
 
-            void addToHistory(const std::string& command);
-            std::string getFromHistory() const;
-
-            virtual void outputChanged(int level);
-
+            // InputBuffer callbacks
             void inputChanged();
             void execute();
-            void hintandcomplete();
+            void hintAndComplete();
             void backspace();
-            void deletechar();
-            void clear();
-            void cursor_right();
-            void cursor_left();
-            void cursor_end();
-            void cursor_home();
-            void history_up();
-            void history_down();
-            void history_search_up();
-            void history_search_down();
-            void scroll_up();
-            void scroll_down();
+            void deleteChar();
+            void cursorRight();
+            void cursorLeft();
+            void cursorEnd();
+            void cursorHome();
+            void historyUp();
+            void historyDown();
+            void historySearchUp();
+            void historySearchDown();
+            void scrollUp();
+            void scrollDown();
             void exit();
 
@@ -138,21 +136,23 @@
 
             std::list<ShellListener*> listeners_;
-            InputBuffer* inputBuffer_;
-            std::stringstream outputBuffer_;
-            bool finishedLastLine_;
-            std::list<std::string> outputLines_;
+            InputBuffer*              inputBuffer_;
+            std::stringstream         outputBuffer_;
+            bool                      bFinishedLastLine_;
+            std::list<std::string>    outputLines_;
             std::list<std::string>::const_iterator scrollIterator_;
-            unsigned int scrollPosition_;
-            unsigned int historyPosition_;
-            bool bAddOutputLevel_;
-            ConfigFileType commandHistoryConfigFileType_;
-            const std::string consoleName_;
-            const bool bScrollable_;
+            unsigned int              scrollPosition_;
+            unsigned int              historyPosition_;
+            ConfigFileType            commandHistoryConfigFileType_;
+
+            std::string               promptPrefix_;
+            const std::string         consoleName_;
+            const bool                bPrependOutputLevel_;
+            const bool                bScrollable_;
 
             // Config values
-            unsigned int maxHistoryLength_;
-            unsigned int historyOffset_;
-            std::vector<std::string> commandHistory_;
-            int softDebugLevel_;
+            unsigned int              maxHistoryLength_;
+            unsigned int              historyOffset_;
+            std::vector<std::string>  commandHistory_;
+            int                       softDebugLevel_;
     };
 }
Index: code/branches/console/src/libraries/core/input/InputPrereqs.h
===================================================================
--- code/branches/console/src/libraries/core/input/InputPrereqs.h	(revision 6007)
+++ code/branches/console/src/libraries/core/input/InputPrereqs.h	(revision 6010)
@@ -179,5 +179,4 @@
             Up            = OIS::KC_UP,              // UpArrow on arrow keypad
             PageUp        = OIS::KC_PGUP,            // PgUp on arrow keypad
-            AltPageUp     = OIS::KC_PGUP+1,          // Alternative PgUp for the IOConsole
             Left          = OIS::KC_LEFT,            // LeftArrow on arrow keypad
             Right         = OIS::KC_RIGHT,           // RightArrow on arrow keypad
@@ -185,5 +184,4 @@
             Down          = OIS::KC_DOWN,            // DownArrow on arrow keypad
             PageDown      = OIS::KC_PGDOWN,          // PgDn on arrow keypad
-            AltPageDown   = OIS::KC_END-1,           // Alternative PgUp for IOConsole
             Insert        = OIS::KC_INSERT,          // Insert on arrow keypad
             Delete        = OIS::KC_DELETE,          // Delete on arrow keypad
@@ -288,9 +286,9 @@
             "UP",
             "PageUp",
-            "", // used for AltPageUp
+            "",
             "Left",
             "",
             "Right",
-            "", // used for AltPageDown
+            "",
             "End", "Down", "PageDown", "Insert", "Delete",
             "","","","","","","",
Index: code/branches/console/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/console/src/orxonox/overlays/InGameConsole.cc	(revision 6007)
+++ code/branches/console/src/orxonox/overlays/InGameConsole.cc	(revision 6010)
@@ -68,5 +68,5 @@
     */
     InGameConsole::InGameConsole()
-        : shell_(new Shell("InGameConsole", true))
+        : shell_(new Shell("InGameConsole", true, true))
         , consoleOverlay_(0)
         , consoleOverlayContainer_(0)
@@ -255,6 +255,4 @@
         // we take -1.2 because the border makes the panel bigger
         this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
-
-        this->shell_->addOutputLevel(true);
 
         COUT(4) << "Info: InGameConsole initialized" << std::endl;
