 +        this.jsterm = new JSTerm(context, aParentNode, mixin, this.console);
 +      }
 +      else {
++        // This is nasty code, but rather than re-architect I'm just going to
++        // document what I think is going on here.
++        // We want a reference to the main HUD so we can add output to it, and
++        // rather than passing a reference to that console around, we look it
++        // up via an id. However we don't have that either so we walk up the
++        // tree to find the first thing that has an id, and make the assumption
++        // that this is the correct one.
++        // For reference, what we're looking for is vbox.hud-box.animated which
++        // is created high up in makeHUDNodes(). I think.
++        // See bug 592469 ?
++        let node = aParentNode;
++        while (!node.hasAttribute("id")) {
++          node = node.parentNode;
++        }
++        let hudId = node.getAttribute("id");
++
++        let doc = aParentNode.ownerDocument;
 +        this.tc = new TermContainer(aParentNode);
 +
 +        let mixin = new JSTermFirefoxMixin(context, this.tc.jstermParent,

+    aOptions = aOptions || {};
+
+    let node = ConsoleUtils.createMessageNode(
+                    this.parentNode.ownerDocument,
+                    aOptions.category || CATEGORY_OUTPUT,
+                    aOptions.severity || SEVERITY_LOG,
+                    aOutputMessage,

+
+  gcli._internal.commandOutputManager.addListener(this.onCommandOutput, this);
+  gcli._internal.createView({
+    document: this.document,
+    inputElement: this.inputNode,
+    completeElement: this.completeNode,
+    inputBackgroundElement: this.inputStack,
