Index: /trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
===================================================================
--- /trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 29540)
+++ /trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 29541)
@@ -161,4 +161,5 @@
 
 if g_hasreadline:
+  import string
   class CompleterNG(rlcompleter.Completer):
     def __init__(self, dic, ctx):
@@ -171,8 +172,21 @@
         http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496812
         """
-        if text == "":
+        if False and text == "":
             return ['\t',None][state]
         else:
             return rlcompleter.Completer.complete(self,text,state)
+
+    def canBeCommand(self, phrase, word):
+        spaceIdx = phrase.find(" ")
+        begIdx = readline.get_begidx()
+        firstWord = (spaceIdx == -1 or begIdx < spaceIdx)
+        if firstWord:
+            return True
+        if phrase.startswith('help'):
+            return True
+        return False
+
+    def canBeMachine(self,phrase,word):
+        return not self.canBeCommand(phrase, word)
 
     def global_matches(self, text):
@@ -185,22 +199,24 @@
         matches = []
         n = len(text)
-
-        for list in [ self.namespace ]:
-            for word in list:
-                if word[:n] == text:
-                    matches.append(word)
-
+        phrase = readline.get_line_buffer()
+
+        if self.canBeCommand(phrase,text):
+            for list in [ self.namespace ]:
+                for word in list:
+                    if word[:n] == text:
+                        matches.append(word)
         try:
-            for m in getMachines(self.ctx, False, True):
-                # although it has autoconversion, we need to cast
-                # explicitly for subscripts to work
-                word = re.sub("(?<!\\\\) ", "\\ ", str(m.name))
-                if word[:n] == text:
-                    matches.append(word)
-                word = str(m.id)
-                if word[0] == '{':
-                    word = word[1:-1]
-                if word[:n] == text:
-                    matches.append(word)
+            if self.canBeMachine(phrase,text):
+                for m in getMachines(self.ctx, False, True):
+                    # although it has autoconversion, we need to cast
+                    # explicitly for subscripts to work
+                    word = re.sub("(?<!\\\\) ", "\\ ", str(m.name))
+                    if word[:n] == text:
+                        matches.append(word)
+                    word = str(m.id)
+                    if word[0] == '{':
+                        word = word[1:-1]
+                    if word[:n] == text:
+                        matches.append(word)
         except Exception,e:
             printErr(e)
