Index: /trunk/src/lib/shell/shell.cc
===================================================================
--- /trunk/src/lib/shell/shell.cc	(revision 7743)
+++ /trunk/src/lib/shell/shell.cc	(revision 7744)
@@ -53,4 +53,13 @@
   ->completionPlugin(0, OrxShell::CompletorFileSystem(".ttf", "fonts/"));
 
+
+  void Shell::testShell()
+  {
+    for (unsigned int i = 0; i < 100; i++)
+      PRINT(0)("%d\n", i);
+  }
+  SHELL_COMMAND(test, Shell, testShell);
+
+
   /**
    * standard constructor
@@ -68,5 +77,4 @@
 
     // BUFFER
-    this->bufferOffset = 0;
     this->bufferIterator = ShellBuffer::getInstance()->getBuffer().begin();
 
@@ -137,4 +145,5 @@
       }
     }
+    repositionText();
   }
 
@@ -155,5 +164,6 @@
     for (std::list<MultiLineText*>::iterator text = this->bufferText.begin(); text != this->bufferText.end(); ++text)
       (*text)->setVisibility(false);
-    this->bufferOffset = 0;
+    // Go to the End again.
+    this->bufferIterator = ShellBuffer::getInstance()->getBuffer().begin();
   }
 
@@ -352,52 +362,48 @@
   void Shell::moveDisplayBuffer(int lineCount)
   {
-    if (this->bufferOffset == 0)
-    {
-      this->bufferIterator = ShellBuffer::getInstance()->getBuffer().end();
-      //     for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
-      //       this->bufferIterator->prevStep();
-    }
-
-    // boundraries
-    if (this->bufferOffset + lineCount > (int)ShellBuffer::getInstance()->getBuffer().size())
-      lineCount = (int)ShellBuffer::getInstance()->getBuffer().size()- this->bufferOffset;
-    else if (this->bufferOffset + lineCount < 0)
-      lineCount = -bufferOffset;
-    this->bufferOffset += lineCount;
-
-    // moving the iterator to the right position
-    int move = 0;
-    while (move != lineCount)
-    {
-      if (move < lineCount)
-      {
-        ++move;
-        this->bufferIterator--;
+    // moving the iterator to the right position (counting the steps)
+    int moves = 0;
+    while (moves != lineCount)
+    {
+      if (moves < lineCount)
+      {
+        if(this->bufferIterator == --ShellBuffer::getInstance()->getBuffer().end())
+          break;
+        ++moves;
+        ++this->bufferIterator;
       }
       else
       {
-        --move;
-        this->bufferIterator++;
-      }
-    }
+        if (this->bufferIterator == ShellBuffer::getInstance()->getBuffer().begin())
+          break;
+        --moves;
+        --this->bufferIterator;
+      }
+    }
+
+
     // redisplay the buffers
+    int linePos = moves;
     std::list<std::string>::const_iterator it = this->bufferIterator;
-    if (it == ShellBuffer::getInstance()->getBuffer().end())
-    {
-      /// FIXME
-      PRINTF(1)("Should not happen\n");
-      it--;
-    }
-    for (std::list<MultiLineText*>::iterator textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt)
-    {
+    std::list<MultiLineText*>::iterator textIt;
+    for (textIt = this->bufferText.begin(); textIt != this->bufferText.end(); ++textIt, ++it)
+    {
+      if (it == ShellBuffer::getInstance()->getBuffer().end())
+      {
+        PRINTF(1)("LAST LINE REACHED\n");
+        break;
+      }
+
+
+      (*textIt)->setRelCoor2D(calculateLinePosition( (linePos++ > 0)? linePos : 0));
       (*textIt)->setText((*it));
-      if (it == ShellBuffer::getInstance()->getBuffer().begin())
-      {
-        /// FIXME
-        PRINTF(1)("Should not happen\n");
-        break;
-      }
-      it--;
-    }
+    }
+    while (textIt != this->bufferText.end())
+    {
+      (*textIt)->setText("");
+      textIt++;
+    }
+
+    this->repositionText();
   }
 
@@ -493,33 +499,3 @@
     ShellBuffer::getInstance()->debug();
   }
-
-  // void Shell::testI (int i)
-  // {
-  //   PRINTF(3)("This is the Test for one Int '%d'\n", i);
-  // }
-  //
-  // void Shell::testS (const char* s)
-  // {
-  //   PRINTF(3)("This is the Test for one String '%s'\n", s);
-  // }
-  //
-  // void Shell::testB (bool b)
-  // {
-  //   PRINTF(3)("This is the Test for one Bool: ");
-  //   if (b)
-  //     PRINTF(3)("true\n");
-  //   else
-  //     PRINTF(3)("false\n");
-  // }
-  //
-  // void Shell::testF (float f)
-  // {
-  //   PRINTF(3)("This is the Test for one Float '%f'\n", f);
-  // }
-  //
-  // void Shell::testSF (const char* s, float f)
-  // {
-  //   PRINTF(3)("This is the Test for one String '%s' and one Float '%f'\n",s , f);
-  // }
-
 }
Index: /trunk/src/lib/shell/shell.h
===================================================================
--- /trunk/src/lib/shell/shell.h	(revision 7743)
+++ /trunk/src/lib/shell/shell.h	(revision 7744)
@@ -79,4 +79,5 @@
     void debug() const;
 
+    void testShell();
   private:
     void repositionText();
@@ -85,10 +86,4 @@
     // helpers //
     Vector2D calculateLinePosition(unsigned int lineNumber);
-
-    //     void testI (int i);
-    //     void testS (const std::string& s);
-    //     void testB (bool b);
-    //     void testF (float f);
-    //     void testSF (const std::string& s, float f);
 
   private:
@@ -107,5 +102,5 @@
     unsigned int                bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters).
     std::list<MultiLineText*>   bufferText;             //!< A list of stored bufferTexts for the display of the buffer.
-    int                         bufferOffset;           //!< how many lines from the bottom up we display the Buffer.
+
     std::list<std::string>::const_iterator  bufferIterator;         //!< used to move through and print the Buffer
   };
Index: /trunk/src/lib/shell/shell_buffer.cc
===================================================================
--- /trunk/src/lib/shell/shell_buffer.cc	(revision 7743)
+++ /trunk/src/lib/shell/shell_buffer.cc	(revision 7744)
@@ -164,10 +164,10 @@
 
       this->lineCount++;
-      this->buffer.push_back(newLineBegin);
+      this->buffer.push_front(newLineBegin);
       if (likely (this->shell != NULL) && unlikely (this->shell->isActive()))
         this->shell->printToDisplayBuffer(newLineBegin);
 
       if (this->buffer.size() > this->bufferSize)
-        this->buffer.pop_front();
+        this->buffer.pop_back();
 
       newLineBegin = newLineEnd+1;
@@ -183,5 +183,5 @@
 
     std::list<std::string>::const_iterator bufferLine;
-    for (bufferLine = this->buffer.begin(); bufferLine != this->buffer.end(); bufferLine++)
+    for (bufferLine = --this->buffer.end(); bufferLine != this->buffer.begin(); --bufferLine)
       printf((*bufferLine).c_str());
   }
Index: /trunk/src/lib/shell/shell_buffer.h
===================================================================
--- /trunk/src/lib/shell/shell_buffer.h	(revision 7743)
+++ /trunk/src/lib/shell/shell_buffer.h	(revision 7744)
@@ -18,4 +18,9 @@
 
   //! A class handling output from orxonox via debug.h
+  /**
+   * the ShellBuffer redirects output from PRINTF(x) to the Shell and STDOUT
+   * the ShellBuffer is a front-filling queue of limited length, that has the
+   * youngest added Entry at the beginning, and the oldest at the end.
+   */
   class ShellBuffer
   {
@@ -26,8 +31,11 @@
     inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer();  return ShellBuffer::singletonRef; };
     /** @returns true if this class is instanciated, false otherwise */
-inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
+    inline static bool isInstanciated() { return (ShellBuffer::singletonRef == NULL)?false:true; };
 
     void registerShell(Shell* shell);
     void unregisterShell(Shell* shell);
+
+    static bool addBufferLineStatic(const char* line, ...);
+    void addBufferLine(const char* line, va_list arg);
 
     // BUFFER //
@@ -35,10 +43,9 @@
     void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; };
     void flush();
-    static bool addBufferLineStatic(const char* line, ...);
-    void addBufferLine(const char* line, va_list arg);
+
     /** @returns the List of stings from the Buffer */
     const std::list<std::string>& getBuffer() const { return this->buffer; };
     /** @returns the Count of lines processed by the Shell. */
-    inline long getLineCount() const { return this->lineCount; };
+    inline unsigned long getLineCount() const { return this->lineCount; };
 
     void debug() const;
@@ -58,4 +65,5 @@
     unsigned long                 lineCount;                          //!< how many Lines have been written out so far.
 
+    // The Beginning of buffer (buffer.front()) is the last added line.
     static std::list<std::string> buffer;                             //!< A list of stored char-arrays(strings) to store the history
   };
