After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 612635 - Alt-F2 - support arrow-up to recall previous commands
Alt-F2 - support arrow-up to recall previous commands
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-11 21:25 UTC by Jeremy Perry
Modified: 2010-05-27 19:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[runDialog] support arrow-up to recall previous commands (4.67 KB, patch)
2010-03-11 23:56 UTC, Maxim Ermilov
reviewed Details | Review
[runDialog] support arrow-up to recall previous commands (4.98 KB, patch)
2010-03-17 15:26 UTC, Maxim Ermilov
committed Details | Review
Imply a recently used command list below the entry instead of above. (1.23 KB, patch)
2010-05-27 17:41 UTC, John Rabotnik
none Details | Review

Description Jeremy Perry 2010-03-11 21:25:45 UTC
See summary - would be nice to be able to recall commands typed into this area, similar to terminal.
Comment 1 Maxim Ermilov 2010-03-11 23:56:07 UTC
Created attachment 155904 [details] [review]
[runDialog] support arrow-up to recall previous commands

runDialog store history in gconf.
Comment 2 Colin Walters 2010-03-16 19:37:23 UTC
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.
Comment 3 Maxim Ermilov 2010-03-17 15:26:44 UTC
Created attachment 156365 [details] [review]
[runDialog] support arrow-up to recall previous commands
Comment 4 Colin Walters 2010-03-18 18:07:33 UTC
Review of attachment 156365 [details] [review]:

Looks fine, thanks!
Comment 5 Raphael Bosshard 2010-05-26 14:44:43 UTC
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?
Comment 6 John Rabotnik 2010-05-27 17:41:18 UTC
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.
Comment 7 Florian Müllner 2010-05-27 19:12:50 UTC
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 :)