diff --git a/common/content/commandline.js b/common/content/commandline.js index 53f9686c..ca5b00d6 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -310,8 +310,13 @@ var CommandMode = Class("CommandMode", { get command() this.widgets.command[1], set command(val) this.widgets.command = val, - get prompt() this.widgets.prompt, - set prompt(val) this.widgets.prompt = val, + get prompt() this._open ? this.widgets.prompt : this._prompt, + set prompt(val) { + if (this._open) + this.widgets.prompt = val; + else + this._prompt = val; + }, open: function CM_open(command) { dactyl.assert(isinstance(this.mode, modes.COMMAND_LINE), @@ -324,6 +329,8 @@ var CommandMode = Class("CommandMode", { this.widgets.prompt = this.prompt; this.widgets.command = command || ""; + this._open = true; + this.input = this.widgets.active.command.inputField; if (this.historyKey) this.history = CommandLine.History(this.input, this.historyKey, this); diff --git a/common/content/modes.js b/common/content/modes.js index 1ea298da..e3887b22 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -445,6 +445,9 @@ var Modes = Module("modes", { }, push: function push(mainMode, extendedMode, params) { + if (this.main == this.IGNORE) + this.pop(); + this.set(mainMode, extendedMode, params, { push: this.topOfStack }); },