GNOME Bugzilla – Bug 612635
Alt-F2 - support arrow-up to recall previous commands
Last modified: 2010-05-27 19:12:50 UTC
See summary - would be nice to be able to recall commands typed into this area, similar to terminal.
Created attachment 155904 [details] [review] [runDialog] support arrow-up to recall previous commands runDialog store history in gconf.
Review of attachment 155904 [details] [review]: ::: data/gnome-shell.schemas @@ +54,3 @@ + <owner>gnome-shell</owner> + <applyto>/desktop/gnome/shell/run_dialog/history</applyto> + <key>/schemas/desktop/gnome/shell/run_dialog/history</key> How about: <short>History for command (Alt-F2) dialog</short> ::: js/ui/runDialog.js @@ +187,1 @@ You should to set this._iHistory = -1 here. But can we call it "this._historyIndex" instead? Also, in practice this isn't a big deal, but to avoid losing writes from say gconf-editor, we should also this._gconf.connect("changed::" + HISTORY_KEY) and reload this._history. @@ +320,3 @@ + this._history.splice(0, this._history.length - HISTORY_LIMIT); + if (this._history.length > HISTORY_LIMIT) { + _saveHistory : function() { In practice this isn't a big deal, but to avoid losing writes from say gconf-editor, we should also this._gconf.connect("changed::" + HISTORY_KEY) and reload this._history. @@ +326,3 @@ + this._saveHistory(); + this._history.push(input); + We should also set this._historyIndex = this._history.length here, I think.
Created attachment 156365 [details] [review] [runDialog] support arrow-up to recall previous commands
Review of attachment 156365 [details] [review]: Looks fine, thanks!
Could we change the behavior to imply a list below the entry? The current behavior shows the most recent entry when pressing UP, implying that the history list is placed above the entry. I think it's more common (Firefox history, Chrome history) to present the history list below the the text entry. I guess the current behavior is conceptually related to how the bash history works?
Created attachment 162128 [details] [review] Imply a recently used command list below the entry instead of above. It took me a while to figure out the up key was used to navigate the previously used commands :-) I guess I'm used to pressing the down key all the time in other apps. I think I seen something about eventually changing it to be a dropdown or gnome-do kind of thing so I guess using the down key would match that design. I've attached a patch that flips the up/down keys around if you do decide to change it.
First of all: it's generally not a good idea to add comments to closed bugs - you risk that you comments/patches go unnoticed. In regard to the proposal in question: I don't think it makes much sense. The current behavior is following the way history works in a terminal. I'm not saying that it's completely out of question to follow the browser navigation bar model (even though alt-f2 clearly resembles a terminal prompt more than an address bar), but just swapping the array keys doesn't really cut it - browser use a drop-down list here, without that it's just bash history with reversed keys :)