Index: code/branches/console/src/libraries/core/IOConsole.cc
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.cc	(revision 6012)
+++ code/branches/console/src/libraries/core/IOConsole.cc	(revision 6013)
@@ -68,5 +68,5 @@
         , originalTerminalSettings_(new termios())
         , bStatusPrinted_(false)
-        , promptString_("orxonox> ")
+        , promptString_("orxonox # ")
     {
         this->setTerminalMode();
@@ -74,11 +74,14 @@
 
         // Manually set the widths of the individual status lines
-        this->statusLineWidths_.push_back(6);
-        this->statusLineMaxWidth_ = 6;
+        this->statusLineWidths_.push_back(20);
+        this->statusLineMaxWidth_ = 20;
     }
 
     IOConsole::~IOConsole()
     {
-        std::cout << "\033[0G\033[K";
+        // Goto last line and erase it
+        if (this->bStatusPrinted_)
+            std::cout << "\033[" << this->statusLineWidths_.size() << 'E';
+        std::cout << "\033[1G\033[K";
         std::cout.flush();
         resetTerminalMode();
@@ -188,8 +191,19 @@
             this->buffer_->buttonPressed(KeyEvent(KeyCode::Escape, '\033', 0));
 
-        // 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";
+        // Determine terminal width and height
+        this->getTerminalSize();
+
+        if (!this->bStatusPrinted_ && this->willPrintStatusLines())
+        {
+            // Print new lines to make way for status lines
+            std::cout << std::string(this->statusLineWidths_.size(), '\n');
+            // Move cursor up again
+            std::cout << "\033[" << this->statusLineWidths_.size() << 'A';
+            this->bStatusPrinted_ = true;
+        }
+        // Move cursor horizontally and erase status and input lines
+        std::cout << "\033[1G\033[J";
+        this->printInputLine();
         this->printStatusLines();
-        this->printInputLine();
         std::cout.flush();
     }
@@ -235,5 +249,5 @@
         std::cout << "\033[1G\033[K";
         // Indicate a command prompt
-        std::cout << promptString_;
+        std::cout << this->promptString_;
         // Save cursor position
         std::cout << "\033[s";
@@ -248,51 +262,54 @@
     void IOConsole::printStatusLines()
     {
-        if (!this->statusLineWidths_.empty())
-        {
-            // Check terminal size
-            int x, y;
-            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;
+        if (this->willPrintStatusLines())
+        {
+            // Save cursor position
+            std::cout << "\033[s";
+            // Move cursor down (don't create a new line here because the buffer might flush then!)
+            std::cout << "\033[1E";
+            std::cout << std::fixed << std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgFPS() << " fps, ";
+            std::cout <<               std::setprecision(2) << std::setw(5) << Game::getInstance().getAvgTickTime() << " ms tick time";
+            // Restore cursor position
+            std::cout << "\033[u";
             this->bStatusPrinted_ = true;
         }
-    }
-
-    int IOConsole::getTerminalSize(int* x, int* y)
+        else
+            this->bStatusPrinted_ = false;
+    }
+
+    inline bool IOConsole::willPrintStatusLines()
+    {
+        return !this->statusLineWidths_.empty()
+             && this->terminalWidth_  >= this->statusLineMaxWidth_
+             && this->terminalHeight_ >= (this->minOutputLines_ + this->statusLineWidths_.size());
+    }
+
+    void IOConsole::getTerminalSize()
     {
 #ifdef TIOCGSIZE
         struct ttysize win;
-#elif defined(TIOCGWINSZ)
+        if (!ioctl(STDIN_FILENO, TIOCGSIZE, &win))
+        {
+            this->terminalWidth_  = win.ts_cols;
+            this->terminalHeight_ = win.ts_lines;
+            return;
+        }
+#elif defined TIOCGWINSZ
         struct winsize win;
+        if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &win))
+        {
+            this->terminalWidth_  = win.ws_col;
+            this->terminalHeight_ = win.ws_row;
+            return;
+        }
+#else
+        const char* s = getenv("COLUMNS");
+        this->terminalWidth_  = s ? strtol(s, NULL, 10) : 80;
+        s = getenv("LINES");
+        this->terminalHeight_ = s ? strtol(s, NULL, 10) : 24;
+        return;
 #endif
-
-#ifdef TIOCGSIZE
-        if (ioctl(STDIN_FILENO, TIOCGSIZE, &win))
-            return 0;
-        *y = win.ts_lines;
-        *x = win.ts_cols;
-#elif defined TIOCGWINSZ
-        if (ioctl(STDIN_FILENO, TIOCGWINSZ, &win))
-            return 0;
-        *y = win.ws_row;
-        *x = win.ws_col;
-#else
-        {
-            const char* s = getenv("LINES");
-            if (s)
-                *y = strtol(s, NULL, 10);
-            else
-                *y = 25;
-            s = getenv("COLUMNS");
-            if (s)
-                *x = strtol(s, NULL, 10);
-            else
-                *x = 80;
-        }
-#endif
-        return 1;
+        this->terminalWidth_  = 80;
+        this->terminalHeight_ = 24;
     }
 
@@ -357,5 +374,5 @@
     {
         // Save cursor position and move it to the beginning of the first output line
-        std::cout << "\033[s\033[" << (1 + this->statusLineWidths_.size()) << "F";
+        std::cout << "\033[s\033[1F";
         // Erase the line
         std::cout << "\033[K";
@@ -373,10 +390,29 @@
     void IOConsole::lineAdded()
     {
-        // Move cursor to the beginning of the first status line and erase screen from there
-        std::cout << "\033[" << this->statusLineWidths_.size() << "F\033[J";
+        // Move cursor to the bottom line
+        if (this->bStatusPrinted_)
+            std::cout << "\033[" << this->statusLineWidths_.size() << 'E';
+        // Create the new line on the screen
+        std::cout << '\n';
+        // Move cursor to the beginning of the new (last) output line
+        std::cout << "\033[" << (1 + this->statusLineWidths_.size()) << 'F';
+        // Erase screen from here
+        std::cout << "\033[J";
         // Print the new output line
         this->printLogText(*(this->shell_->getNewestLineIterator()));
-        std::cout << std::endl;
+        // Move cursor down
+        std::cout << "\033[1E";
+        // Print status and input lines
+        this->printInputLine();
         this->printStatusLines();
+        std::cout.flush();
+    }
+
+    /**
+    @brief
+        Called if the text in the input-line has changed.
+    */
+    void IOConsole::inputChanged()
+    {
         this->printInputLine();
         std::cout.flush();
@@ -385,7 +421,7 @@
     /**
     @brief
-        Called if the text in the input-line has changed.
-    */
-    void IOConsole::inputChanged()
+        Called if the position of the cursor in the input-line has changed.
+    */
+    void IOConsole::cursorChanged()
     {
         this->printInputLine();
@@ -395,14 +431,4 @@
     /**
     @brief
-        Called if the position of the cursor in the input-line has changed.
-    */
-    void IOConsole::cursorChanged()
-    {
-        this->printInputLine();
-        std::cout.flush();
-    }
-
-    /**
-    @brief
         Called if a command is about to be executed
     */
Index: code/branches/console/src/libraries/core/IOConsole.h
===================================================================
--- code/branches/console/src/libraries/core/IOConsole.h	(revision 6012)
+++ code/branches/console/src/libraries/core/IOConsole.h	(revision 6013)
@@ -56,5 +56,6 @@
         void setTerminalMode();
         void resetTerminalMode();
-        int getTerminalSize(int* x, int* y);
+        void getTerminalSize();
+        bool willPrintStatusLines();
 
         void printLogText(const std::string& line);
@@ -70,7 +71,10 @@
         void executed();
         void exit();
+
         Shell*                  shell_;
         InputBuffer*            buffer_;
         termios*                originalTerminalSettings_;
+        unsigned int            terminalWidth_;
+        unsigned int            terminalHeight_;
         bool                    bPrintStatusLine_;
         bool                    bStatusPrinted_;
