Index: code/branches/console/src/libraries/core/Core.cc
===================================================================
--- code/branches/console/src/libraries/core/Core.cc	(revision 6000)
+++ code/branches/console/src/libraries/core/Core.cc	(revision 6004)
@@ -67,5 +67,4 @@
 #include "LuaState.h"
 #include "ScopedSingletonManager.h"
-#include "Shell.h"
 #include "TclBind.h"
 #include "TclThreadManager.h"
@@ -233,6 +232,4 @@
         this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));
 
-        // create a shell
-        this->shell_.reset(new Shell());
         // create persistent io console
         this->ioConsole_.reset(new IOConsole());
Index: code/branches/console/src/libraries/core/Core.h
===================================================================
--- code/branches/console/src/libraries/core/Core.h	(revision 6000)
+++ code/branches/console/src/libraries/core/Core.h	(revision 6004)
@@ -94,5 +94,4 @@
             scoped_ptr<TclBind>           tclBind_;
             scoped_ptr<TclThreadManager>  tclThreadManager_;
-            scoped_ptr<Shell>             shell_;
             scoped_ptr<IOConsole>         ioConsole_;
             // graphical
Index: code/branches/console/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.cc	(revision 6000)
+++ code/branches/console/src/libraries/core/IOConsole.cc	(revision 6004)
@@ -52,5 +52,5 @@
     const std::string promptString_g = "orxonox>";
 
-#if 1//def ORXONOX_PLATFORM_UNIX
+#ifdef ORXONOX_PLATFORM_UNIX
 
     termios* IOConsole::originalTerminalSettings_;
@@ -67,15 +67,15 @@
 
     IOConsole::IOConsole()
-        : shell_(Shell::getInstance())
-        , buffer_(Shell::getInstance().getInputBuffer())
+        : shell_(new Shell("IOConsole", false))
+        , buffer_(shell_->getInputBuffer())
+        , originalTerminalSettings_(new termios())
         , bStatusPrinted_(false)
     {
-        this->originalTerminalSettings_ = new termios;
         this->setTerminalMode();
-        this->shell_.registerListener(this);
-
+        this->shell_->registerListener(this);
 
         // Manually set the widths of the individual status lines
-        this->statusLineWidths_.push_back(20);
+        this->statusLineWidths_.push_back(6);
+        this->statusLineMaxWidth_ = 6;
     }
 
@@ -86,4 +86,5 @@
         resetTerminalMode();
         delete this->originalTerminalSettings_;
+        this->shell_->destroy();
     }
 
@@ -189,5 +190,7 @@
             this->buffer_->buttonPressed(KeyEvent(KeyCode::Escape, '\033', 0));
 
-        // Print input line
+        // Clear screen below the last output line by first moving the cursor to the beginning of the first status line
+        std::cout << "\033[" << (this->bStatusPrinted_ ? this->statusLineWidths_.size() : 0) << "F\033[J";
+        this->printStatusLines();
         this->printInputLine();
     }
@@ -233,6 +236,4 @@
         // Set cursor to the beginning of the line and erase the line
         std::cout << "\033[1G\033[K";
-        // Print status line
-        //std::cout << std::fixed << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgFPS() << " fps, " << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgTickTime() << " ms avg ticktime # ";
         // Indicate a command prompt
         std::cout << promptString_g;
@@ -240,5 +241,5 @@
         std::cout << "\033[s";
         // Print command line buffer
-        std::cout << this->shell_.getInput();
+        std::cout << this->shell_->getInput();
         // Restore cursor position and move it to the right
         std::cout << "\033[u";
@@ -252,18 +253,14 @@
         if (!this->statusLineWidths_.empty())
         {
-            if (this->bStatusPrinted_)
-            {
-                // Erase the status lines first (completely, including new lines!)
-
-            }
             // Check terminal size
-            /*
             int x, y;
-            if (this->getTerminalSize(&x, &y) && (x < statusTextWidth_g || y < (2 + statusTextHeight_g)))
+            if (this->getTerminalSize(&x, &y) && (x < (int)this->statusLineMaxWidth_ || y < (int)(this->minOutputLines_ + this->statusLineWidths_.size())))
             {
                 this->bStatusPrinted_ = false;
                 return;
             }
-            */
+            std::cout << "Status" << std::endl;
+            std::cout.flush();
+            this->bStatusPrinted_ = true;
         }
     }
@@ -307,6 +304,6 @@
 
     IOConsole::IOConsole()
-        : shell_(Shell::getInstance())
-        , buffer_(Shell::getInstance().getInputBuffer())
+        : shell_(new Shell("IOConsole", false))
+        , buffer_(shell_->getInputBuffer())
     {
         this->setTerminalMode();
@@ -329,5 +326,5 @@
     }
 
-    void IOConsole::print(const std::string& text)
+    void IOConsole::printLogText(const std::string& text)
     {
     }
@@ -360,9 +357,9 @@
     {
         // Save cursor position and move it to the beginning of the first output line
-        std::cout << "\033[s\033[" << (1 + 0/*statusTextHeight_g*/) << "F";
+        std::cout << "\033[s\033[" << (1 + this->statusLineWidths_.size()) << "F";
         // Erase the line
         std::cout << "\033[K";
         // Reprint the last output line
-        this->printLogText(*(this->shell_.getNewestLineIterator()));
+        this->printLogText(*(this->shell_->getNewestLineIterator()));
         // Restore cursor
         std::cout << "\033[u";
@@ -376,13 +373,11 @@
     void IOConsole::lineAdded()
     {
-        // Save cursor and move it to the beginning of the first status line
-        std::cout << "\033[s\033[" << 0/*statusTextHeight_g*/ << "F";
-        // Create a new line and move cursor to the beginning of it (one cell up)
-        std::cout << std::endl << "\033[1F";
+        // Move cursor to the beginning of the first status line and erase screen from there
+        std::cout << "\033[" << this->statusLineWidths_.size() << "F\033[J";
         // Print the new output line
-        this->printLogText(*(this->shell_.getNewestLineIterator()));
-        // Restore cursor (for horizontal position) and move it down again (just in case the lines were shifted)
-        std::cout << "\033[u\033[" << (1 + 0/*statusTextHeight_g*/) << "B";
-        std::cout.flush();
+        this->printLogText(*(this->shell_->getNewestLineIterator()));
+        std::cout << std::endl;
+        this->printStatusLines();
+        this->printInputLine();
     }
 
@@ -414,5 +409,5 @@
         std::cout << "\033[1G";
         // Print command so the user knows what he has typed
-        std::cout << promptString_g << this->shell_.getInput() << std::endl;
+        std::cout << promptString_g << this->shell_->getInput() << std::endl;
         this->printInputLine();
     }
Index: code/branches/console/src/libraries/core/IOConsole.h
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.h	(revision 6000)
+++ code/branches/console/src/libraries/core/IOConsole.h	(revision 6004)
@@ -70,5 +70,5 @@
         void executed();
         void exit();
-        Shell&                  shell_;
+        Shell*                  shell_;
         InputBuffer*            buffer_;
         static termios*         originalTerminalSettings_;
@@ -76,4 +76,6 @@
         bool                    bStatusPrinted_;
         std::vector<unsigned>   statusLineWidths_;
+        unsigned int            statusLineMaxWidth_;
+        static const unsigned   minOutputLines_ = 3;
 
         static IOConsole* singletonPtr_s;
Index: code/branches/console/src/libraries/core/Shell.cc
===================================================================
--- code/branches/console/src/libraries/core/Shell.cc	(revision 6000)
+++ code/branches/console/src/libraries/core/Shell.cc	(revision 6004)
@@ -34,12 +34,8 @@
 #include "CoreIncludes.h"
 #include "ConfigValueIncludes.h"
-#include "Core.h"
 #include "ConsoleCommand.h"
 
 namespace orxonox
 {
-    SetConsoleCommand(Shell, clearShell, true);
-    SetConsoleCommand(Shell, history, true);
-
     SetConsoleCommandShortcut(OutputHandler, log);
     SetConsoleCommandShortcut(OutputHandler, error);
@@ -48,8 +44,9 @@
     SetConsoleCommandShortcut(OutputHandler, debug);
 
-    Shell* Shell::singletonPtr_s = 0;
-
-    Shell::Shell()
-        : OutputListener("shell")
+    Shell::Shell(const std::string& consoleName, bool bScrollable)
+        : inputBuffer_(new InputBuffer())
+        , OutputListener(consoleName)
+        , consoleName_(consoleName)
+        , bScrollable_(bScrollable)
     {
         RegisterRootObject(Shell);
@@ -63,6 +60,4 @@
 
         this->clearLines();
-
-        this->inputBuffer_ = new InputBuffer();
         this->configureInputBuffer();
 
@@ -79,5 +74,11 @@
         for (OutputHandler::OutputVectorIterator it = OutputHandler::getInstance().getOutputVectorBegin();
             it != OutputHandler::getInstance().getOutputVectorEnd(); ++it)
-            this->addLine(it->second, it->first);
+        {
+            if (it->first <= this->getSoftDebugLevel())
+            {
+                this->outputBuffer_ << it->second;
+                this->outputChanged(it->first);
+            }
+        }
 
         // Register the shell as output listener
@@ -93,7 +94,7 @@
     void Shell::setConfigValues()
     {
-        SetConfigValueGeneric(commandHistoryConfigFileType_, maxHistoryLength_, "maxHistoryLength_", "Shell", 100)
+        SetConfigValue(maxHistoryLength_, 100)
             .callback(this, &Shell::commandHistoryLengthChanged);
-        SetConfigValueGeneric(commandHistoryConfigFileType_, historyOffset_, "historyOffset_", "Shell", 0)
+        SetConfigValue(historyOffset_, 0)
             .callback(this, &Shell::commandHistoryOffsetChanged);
         SetConfigValueVectorGeneric(commandHistoryConfigFileType_, commandHistory_, std::vector<std::string>());
@@ -104,7 +105,7 @@
         const unsigned int defaultLevel = 3;
 #endif
-        SetConfigValueGeneric(ConfigFileType::Settings, softDebugLevel_, "softDebugLevelShell", "OutputHandler", defaultLevel)
+        SetConfigValueGeneric(ConfigFileType::Settings, softDebugLevel_, "softDebugLevel" + this->consoleName_, "OutputHandler", defaultLevel)
             .description("The maximal level of debug output shown in the Shell");
-        OutputHandler::getInstance().setSoftDebugLevel("shell", this->softDebugLevel_);
+        this->setSoftDebugLevel(this->softDebugLevel_);
     }
 
@@ -149,9 +150,5 @@
     }
 
-    void Shell::clearShell()
-    {
-        Shell::getInstance().clearLines();
-    }
-
+    /*
     void Shell::history()
     {
@@ -163,4 +160,5 @@
             instance.addLine(instance.commandHistory_[i], -1);
     }
+    */
 
     void Shell::registerListener(ShellListener* listener)
@@ -195,5 +193,5 @@
     {
         if (level <= this->softDebugLevel_)
-            this->lines_.push_front(line);
+            this->outputLines_.push_front(line);
         this->updateListeners<&ShellListener::lineAdded>();
     }
@@ -201,6 +199,6 @@
     void Shell::clearLines()
     {
-        this->lines_.clear();
-        this->scrollIterator_ = this->lines_.begin();
+        this->outputLines_.clear();
+        this->scrollIterator_ = this->outputLines_.begin();
 
         this->scrollPosition_ = 0;
@@ -215,10 +213,10 @@
             return this->scrollIterator_;
         else
-            return this->lines_.begin();
+            return this->outputLines_.begin();
     }
 
     std::list<std::string>::const_iterator Shell::getEndIterator() const
     {
-        return this->lines_.end();
+        return this->outputLines_.end();
     }
 
@@ -239,10 +237,10 @@
     }
 
-    void Shell::outputChanged()
-    {
-        std::string output;
-        bool newline;
+    void Shell::outputChanged(int level)
+    {
+        bool newline = false;
         do
         {
+            std::string output;
             std::getline(this->outputBuffer_, output);
 
@@ -261,12 +259,12 @@
             {
                 if (this->bAddOutputLevel_)
-                    output.insert(0, 1, static_cast<char>(OutputHandler::getInstance().getOutputLevel()));
-
-                this->lines_.push_front(output);
+                    output.insert(0, 1, static_cast<char>(level));
+
+                this->outputLines_.push_front(output);
 
                 if (this->scrollPosition_)
                     this->scrollPosition_++;
                 else
-                    this->scrollIterator_ = this->lines_.begin();
+                    this->scrollIterator_ = this->outputLines_.begin();
 
                 this->finishedLastLine_ = newline;
@@ -279,5 +277,5 @@
             else
             {
-                (*this->lines_.begin()) += output;
+                (*this->outputLines_.begin()) += output;
                 this->finishedLastLine_ = newline;
                 this->updateListeners<&ShellListener::onlyLastLineChanged>();
@@ -413,5 +411,5 @@
     void Shell::scroll_up()
     {
-        if (this->scrollIterator_ != this->lines_.end())
+        if (this->scrollIterator_ != this->outputLines_.end())
         {
             ++this->scrollIterator_;
@@ -424,5 +422,5 @@
     void Shell::scroll_down()
     {
-        if (this->scrollIterator_ != this->lines_.begin())
+        if (this->scrollIterator_ != this->outputLines_.begin())
         {
             --this->scrollIterator_;
@@ -443,5 +441,5 @@
         this->clear();
         this->scrollPosition_ = 0;
-        this->scrollIterator_ = this->lines_.begin();
+        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 6000)
+++ code/branches/console/src/libraries/core/Shell.h	(revision 6004)
@@ -32,5 +32,4 @@
 #include "CorePrereqs.h"
 
-#include <cassert>
 #include <list>
 #include <sstream>
@@ -39,7 +38,7 @@
 
 #include "util/OutputHandler.h"
-#include "input/InputBuffer.h"
 #include "OrxonoxClass.h"
 #include "ConfigFileManager.h"
+#include "input/InputBuffer.h"
 
 namespace orxonox
@@ -62,13 +61,9 @@
     };
 
-    class _CoreExport Shell : public Singleton<Shell>, virtual public OrxonoxClass, public OutputListener
+    class _CoreExport Shell : virtual public OrxonoxClass, public OutputListener
     {
-        friend class Singleton<Shell>;
         public:
-            Shell();
+            Shell(const std::string& consoleName, bool bScrollable);
             virtual ~Shell();
-
-            static void clearShell();
-            static void history();
 
             void setConfigValues();
@@ -100,5 +95,5 @@
 
             inline unsigned int getNumLines() const
-                { return this->lines_.size(); }
+                { return this->outputLines_.size(); }
             inline unsigned int getScrollPosition() const
                 { return this->scrollPosition_; }
@@ -115,5 +110,5 @@
             std::string getFromHistory() const;
 
-            virtual void outputChanged();
+            virtual void outputChanged(int level);
 
             void inputChanged();
@@ -146,17 +141,18 @@
             std::stringstream outputBuffer_;
             bool finishedLastLine_;
-            std::list<std::string> lines_;
+            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_;
+
+            // Config values
+            unsigned int maxHistoryLength_;
+            unsigned int historyOffset_;
             std::vector<std::string> commandHistory_;
-            unsigned int maxHistoryLength_;
-            unsigned int historyPosition_;
-            unsigned int historyOffset_;
-            bool bAddOutputLevel_;
             int softDebugLevel_;
-
-            ConfigFileType commandHistoryConfigFileType_;
-
-            static Shell* singletonPtr_s;
     };
 }
Index: code/branches/console/src/libraries/util/OutputHandler.cc
===================================================================
--- code/branches/console/src/libraries/util/OutputHandler.cc	(revision 6000)
+++ code/branches/console/src/libraries/util/OutputHandler.cc	(revision 6004)
@@ -93,5 +93,5 @@
             this->outputStream_ = &this->logFile_;
             // Use default level until we get the configValue from the Core
-            outputHandler.setSoftDebugLevel(this->getOutputListenerName(), OutputLevel::Debug);
+            this->setSoftDebugLevel(OutputLevel::Debug);
             outputHandler.registerOutputListener(this);
         }
@@ -152,13 +152,13 @@
             this->outputStream_ = &this->buffer_;
             // We capture as much input as the listener with the highest level
-            outputHandler.setSoftDebugLevel(this->getOutputListenerName(), OutputHandler::getSoftDebugLevel());
+            this->setSoftDebugLevel(OutputHandler::getSoftDebugLevel());
             outputHandler.registerOutputListener(this);
         }
 
         //! Pushed the just written output to the internal array
-        void outputChanged()
+        void outputChanged(int level)
         {
             // Read ostringstream and store it
-            this->output_.push_back(std::make_pair(OutputHandler::getInstance().getOutputLevel(), this->buffer_.str()));
+            this->output_.push_back(std::make_pair(level, this->buffer_.str()));
             // Clear content and flags
             this->buffer_.str(std::string());
@@ -210,4 +210,6 @@
         }
         this->listeners_.push_back(listener);
+        // Update global soft debug level
+        this->setSoftDebugLevel(listener->getOutputListenerName(), listener->getSoftDebugLevel());
     }
 
Index: code/branches/console/src/libraries/util/OutputHandler.h
===================================================================
--- code/branches/console/src/libraries/util/OutputHandler.h	(revision 6000)
+++ code/branches/console/src/libraries/util/OutputHandler.h	(revision 6004)
@@ -142,5 +142,5 @@
             //! Returns the soft debug level for a device by its name   @return The level or -1 if the listener was not found
             int  getSoftDebugLevel(const std::string& name) const;
-            //! Sets the soft debug level for a listener by its name
+            //! Sets the soft debug level for a listener by its name   @remarks Only works for registered listeners!
             void setSoftDebugLevel(const std::string& name, int level);
 
@@ -231,11 +231,20 @@
             : outputStream_(NULL)
             , name_(name)
+            , softDebugLevel_(OutputLevel::Info)
         {}
         virtual ~OutputListener() {}
 
         //! Gets called whenever output is put into the stream
-        virtual void outputChanged() {}
+        virtual void outputChanged(int level) {}
         //! Returns the name of this output listener
         const std::string& getOutputListenerName() const { return this->name_; }
+        //! Returns the soft debug level of the listener
+        int getSoftDebugLevel() const { return this->softDebugLevel_; }
+        //! Sets the soft debug level of the listener
+        void setSoftDebugLevel(int level)
+        {
+            this->softDebugLevel_ = level;
+            OutputHandler::getInstance().setSoftDebugLevel(this->name_, level);
+        }
 
     protected:
@@ -257,5 +266,5 @@
                 stream << output;
                 stream.flush();
-                (*it)->outputChanged();
+                (*it)->outputChanged(this->outputLevel_);
             }
         }
