Index: gui/wxpython/gui_modules/goutput.py
===================================================================
--- gui/wxpython/gui_modules/goutput.py	(revision 39871)
+++ gui/wxpython/gui_modules/goutput.py	(working copy)
@@ -24,6 +24,7 @@
 import time
 import threading
 import Queue
+import shlex
 
 import wx
 import wx.stc
@@ -269,7 +270,8 @@
         
         # p1 = self.cmd_output.GetCurrentPos()
         p1 = self.cmd_output.GetEndStyled()
-        self.cmd_output.GotoPos(p1)
+#        self.cmd_output.GotoPos(p1)
+        self.cmd_output.DocumentEnd()
         
         for line in text.splitlines():
             # fill space
@@ -756,6 +758,7 @@
     def __init__(self, parent, id, margin=False, wrap=None):
         wx.stc.StyledTextCtrl.__init__(self, parent, id)
         self.parent = parent
+        self.SetUndoCollection(True)
 
         #
         # styles
@@ -789,6 +792,7 @@
         # bindins
         #
         self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
+        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)
         
     def SetStyle(self):
         """!Set styles for styled text output windows with type face 
@@ -830,7 +834,30 @@
         self.StyleSetSpec(self.StyleError,   self.StyleErrorSpec)
         self.StyleSetSpec(self.StyleWarning, self.StyleWarningSpec)
         self.StyleSetSpec(self.StyleMessage, self.StyleMessageSpec)
-        self.StyleSetSpec(self.StyleUnknown, self.StyleUnknownSpec)        
+        self.StyleSetSpec(self.StyleUnknown, self.StyleUnknownSpec)    
+        
+    def OnKeyPressed(self, event):
+        line = ''
+        if event.GetKeyCode() == 13:
+            line = str(self.GetCurLine()[0]).strip()
+            if line == '' or line == None: 
+                self.DocumentEnd()
+                return            
+            
+#            if cmdString[:2] == 'd.' and not self.parent.curr_page:
+#                self.parent.NewDisplay(show=True)
+            
+            cmd = shlex.split(str(line))
+            if len(cmd) > 1:
+                self.parent.RunCmd(cmd, switchPage = True)
+            else:
+                self.parent.RunCmd(cmd, switchPage = False)
+            if self.GetColumn(self.GetCurrentPos()) < len(line):
+                self.DeleteBack()
+                self.Undo()
+                self.DocumentEnd()
+                        
+        event.Skip()
 
     def OnDestroy(self, evt):
         """!The clipboard contents can be preserved after
