Last Comment Bug 623749 - On Windows, map Control-A (Ctrl+A) to Select All in the Web Console input
: On Windows, map Control-A (Ctrl+A) to Select All in the Web Console input
Status: RESOLVED FIXED
[good-first-bugs][lang=javascript][me...
: dev-doc-complete
Product: Firefox
Classification: Client Software
Component: Developer Tools: Console (show other bugs)
: unspecified
: x86 Windows XP
: -- minor with 1 vote (vote)
: Firefox 22
Assigned To: Cory Gackenheimer
:
Mentors:
: 627822 632829 634403 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-06 15:42 PST by Erik Vold
Modified: 2014-01-24 06:04 PST (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Control + a on windows will select all in Web Console (5.39 KB, patch)
2013-02-20 12:34 PST, Cory Gackenheimer
mihai.sucan: review+
Details | Diff | Splinter Review
new patch to reflect requested changes (7.16 KB, patch)
2013-02-25 12:06 PST, Cory Gackenheimer
mihai.sucan: review+
Details | Diff | Splinter Review
folded patch (4.20 KB, patch)
2013-02-25 13:33 PST, Mihai Sucan [:msucan]
no flags Details | Diff | Splinter Review

Description Erik Vold 2011-01-06 15:42:42 PST
ctrl + a is doing what the Home keyboard button does, move the cursor to the beginning of the line. I'm expected this hotkey to select all though.
Comment 1 Rob Campbell [:rc] (:robcee) 2011-01-06 16:07:37 PST
this is working as-expected. Ctrl/Cmd-E would go to end of line except for bug 609744.

You need to select a line or focus the console output area for Cmd/Ctrl-A to work.
Comment 2 Erik Vold 2011-01-06 16:37:35 PST
(In reply to comment #1)
> this is working as-expected.

Why is this behavior expected? and how is this behavior useful? since the 'page up' key seems to do exactly the same thing and now I can't find a hotkey to select all..

> Ctrl/Cmd-E would go to end of line except for bug
> 609744.

ok, idk why you bring that up though..

> You need to select a line or focus the console output area for Cmd/Ctrl-A to
> work.

I'm referring to the console's input area (which I didn't make clear before sorry), so I don't think the howto's of selecting output are relevant.
Comment 3 David Dahl :ddahl 2011-01-06 17:02:39 PST
(In reply to comment #2)
> (In reply to comment #1)
> > this is working as-expected.
> 
> Why is this behavior expected? and how is this behavior useful? since the 'page
> up' key seems to do exactly the same thing and now I can't find a hotkey to
> select all..

All consoles on all platforms map control-a to beginning og line and control-e to end of line. This is actually very helpful to those with this muscle memory.
Comment 4 Erik Vold 2011-01-06 17:08:42 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > this is working as-expected.
> > 
> > Why is this behavior expected? and how is this behavior useful? since the 'page
> > up' key seems to do exactly the same thing and now I can't find a hotkey to
> > select all..
> 
> All consoles on all platforms map control-a to beginning og line and control-e
> to end of line. This is actually very helpful to those with this muscle memory.

Hmm I see, so Google Chrome is doing the same, but Firebug does not..

And how is a user supposed to select all?
Comment 5 David Dahl :ddahl 2011-01-06 17:26:50 PST
(In reply to comment #4)
> > All consoles on all platforms map control-a to beginning og line and control-e
> > to end of line. This is actually very helpful to those with this muscle memory.
> 
> Hmm I see, so Google Chrome is doing the same, but Firebug does not..
> 
> And how is a user supposed to select all?

Sounds like we need to file a bug. Just checked my linux terminal - they make you use a menu item. perhaps we map it to alt - a?

alt-a actually does it for me on linux. awesome.
Comment 6 Rob Campbell [:rc] (:robcee) 2011-01-07 06:46:47 PST
let's reopen this rather than file a new bug but modify the summary.

Alt-a is not going to work on all platforms. On OS X, it produces 'å'. Maybe ctrl-shift-a?
Comment 7 Philip Chee 2011-01-07 08:25:14 PST
Err Rob, the way we normally do it here in Mozilla land is to have platform specific key bindings so that we can be consistent with platform conventions.
Comment 8 Rob Campbell [:rc] (:robcee) 2011-01-07 10:45:05 PST
(In reply to comment #7)
> Err Rob, the way we normally do it here in Mozilla land is to have platform
> specific key bindings so that we can be consistent with platform conventions.

yes, I know. The input line's a bit special, though I'm inclined to believe that we should probably change ctrl-a/e to do what users expect in Windows.
Comment 9 David Dahl :ddahl 2011-01-07 10:46:39 PST
(In reply to comment #7)
> Err Rob, the way we normally do it here in Mozilla land is to have platform
> specific key bindings so that we can be consistent with platform conventions.

what would be the platform conventions in this case? Apple-a on mac (which should work), alt-a on linux just works, not sure about windows.
Comment 10 Rob Campbell [:rc] (:robcee) 2011-01-07 11:01:01 PST
cmd-a works on mac (select-all, no change required)., ctrl-a goes to beginning of line (expected, emacs keybindings for text widgets).

ctrl-a in linux should go to beginning of line. you say alt-a selects all? That's probably correct there.

ctrl-a on Windows (different from what we have now). Only change required.
Comment 11 Kevin Dangoor 2011-01-24 09:11:48 PST
*** Bug 627822 has been marked as a duplicate of this bug. ***
Comment 12 Kevin Dangoor 2011-02-09 12:50:43 PST
*** Bug 632829 has been marked as a duplicate of this bug. ***
Comment 13 David Dahl :ddahl 2011-02-15 14:24:40 PST
*** Bug 634406 has been marked as a duplicate of this bug. ***
Comment 14 Frank Yan (:fryn) 2011-02-15 14:34:44 PST
(In reply to comment #10)
> ctrl-a on Windows (different from what we have now). Only change required.

On both Windows and Linux:
If ctrl+a is mapped to select all, ctrl+e should not be mapped to end of line.

(Additional context: On Windows, ctrl+e had been mapped to the search box, since at least before Firefox 2 (we took it from IE). It got removed and wasn't put back for 4.0 due to a string freeze fiasco, but we'll likely put it back for 4.x.)

> ctrl-a in linux should go to beginning of line. you say alt-a selects all?
> That's probably correct there.

In all the input fields I've used in Firefox on Linux, both ctrl+a and alt+a select all. I don't think we should break this, but if we must map ctrl+a to beginning of line, alt+a should still select all.

> cmd-a works on mac (select-all, no change required)., ctrl-a goes to beginning
> of line (expected, emacs keybindings for text widgets).

I agree. If we really want to match the convention of emacs keybindings that Cocoa text widgets use, ctrl+shift+a should select to beginning of line, and ctrl+shift+e should select to end of line.
Comment 15 Frank Yan (:fryn) 2011-02-15 16:05:17 PST
*** Bug 634403 has been marked as a duplicate of this bug. ***
Comment 16 Frank Yan (:fryn) 2011-02-15 16:10:28 PST
ddahl just convinced me that the Web Console is actually a command line interface for the browser/web, so I'd like to revise my position.

On Windows:
Ctrl+A - use default keybinding (Select All)
Ctrl+E - unmapped
since even Windows's cmd.exe doesn't use emacs-style keybindings.

On Mac and Linux:
Ctrl+A - beginning of line (no change)
Ctrl+E - end of line (no change)
Ctrl+Shift+A - select to beginning of line
Ctrl+Shift+E - select to end of line

On Linux:
Alt+A - Select All
Comment 17 Paul Rouget [:paul] 2012-12-05 03:33:01 PST
triage. Filter on PINKISBEAUTIFUL
Comment 18 Rob Campbell [:rc] (:robcee) 2012-12-28 13:32:48 PST
still a bug!
Comment 19 Will Carter 2013-01-15 15:49:59 PST
Hey I'm new to the group and would like to look at this more to get my feet wet. Have we established a convention for Windows yet or is it still up in the air?
Comment 20 Frank Yan (:fryn) 2013-01-15 16:28:58 PST
(In reply to Will Carter from comment #19)
> Hey I'm new to the group and would like to look at this more to get my feet
> wet. Have we established a convention for Windows yet or is it still up in
> the air?

As I understand it, this just needs a patch.
I recommend comment 16's list of mappings, but Ctrl+A -> Select All is the most important one.
Comment 21 Cory Gackenheimer 2013-02-19 15:50:15 PST
(In reply to Will Carter from comment #19)
> Hey I'm new to the group and would like to look at this more to get my feet
> wet. Have we established a convention for Windows yet or is it still up in
> the air?

Is this fair game to work on, or are you still working on a patch for this?
Comment 22 Frank Yan (:fryn) 2013-02-19 15:55:12 PST
(In reply to Cory Gackenheimer from comment #21)
> (In reply to Will Carter from comment #19)
> > Hey I'm new to the group and would like to look at this more to get my feet
> > wet. Have we established a convention for Windows yet or is it still up in
> > the air?
> 
> Is this fair game to work on, or are you still working on a patch for this?

I'd say, take it! :)
Comment 23 Mihai Sucan [:msucan] 2013-02-20 06:01:56 PST
(In reply to Rob Campbell [:rc] (:robcee) from comment #18)
> still a bug!

Please CC me when I'm added as a mentor to a bug. Thank you!
Comment 24 Cory Gackenheimer 2013-02-20 12:34:53 PST
Created attachment 716181 [details] [diff] [review]
Control + a on windows will select all in Web Console
Comment 25 Mihai Sucan [:msucan] 2013-02-25 09:32:30 PST
Comment on attachment 716181 [details] [diff] [review]
Control + a on windows will select all in Web Console

Review of attachment 716181 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for your patch!

Giving r+ with the comments below addressed.

::: browser/devtools/webconsole/test/Makefile.in
@@ +125,5 @@
>  endif
>  
> +ifeq ($(OS_ARCH),WINNT)
> +MOCHITEST_BROWSER_FILES += \
> +		browser_webconsole_bug_623749.js \

can you please rename the test to something more self-explanatory? Maybe "browser_webconsole_ctrl_a_select_all_winnt.js".

::: browser/devtools/webconsole/test/browser_webconsole_bug_623749.js
@@ +1,4 @@
> +/* Any copyright is dedicated to the Public Domain.
> + * http://creativecommons.org/publicdomain/zero/1.0/ */
> +
> +// Test for https://bugzilla.mozilla.org/show_bug.cgi?id=623749

Please explain what the test does. Maybe: Test for bug 623749 - Map Ctrl+A to Select All, in the Web Console input, on Windows.

@@ +14,5 @@
> +
> +
> +function runTest(HUD) {
> +  jsterm = HUD.jsterm;
> +  jsterm.setInputValue("Ingore These Four Words");

typo: s/ingore/ignore/

@@ +17,5 @@
> +  jsterm = HUD.jsterm;
> +  jsterm.setInputValue("Ingore These Four Words");
> +  inputNode = jsterm.inputNode;
> +
> +  //test select all with control + a

nit: space after //

::: browser/devtools/webconsole/webconsole.js
@@ +3114,5 @@
>        let closePopup = false;
>        switch (aEvent.charCode) {
>          case 97:
>            // control-a
> +          if (Services.appinfo.OS != "WINNT") {

nit: instead of nesting everything, you could do an early break for winnt.

@@ +3133,5 @@
>            closePopup = true;
>            break;
>          case 101:
>            // control-e
> +          if (Services.appinfo.OS != "WINNT") {

Same as above.
Comment 26 Cory Gackenheimer 2013-02-25 12:06:24 PST
Created attachment 718008 [details] [diff] [review]
new patch to reflect requested changes

Thanks for the review, I have submitted a new patch file to address the items from the previous review.
Comment 27 Mihai Sucan [:msucan] 2013-02-25 13:31:17 PST
Comment on attachment 718008 [details] [diff] [review]
new patch to reflect requested changes

Cory: thanks for the quick update. Next time please fold the two patches. The second patch requires the first one.

You should use MQ with HG, see http://mercurial.selenic.com/wiki/MqTutorial

MQ helps a lot with managing patches.

I'm going to push this patch to the try servers.
Comment 28 Mihai Sucan [:msucan] 2013-02-25 13:33:20 PST
Created attachment 718053 [details] [diff] [review]
folded patch

Folded the two patches.

Pushed to the try servers:

https://tbpl.mozilla.org/?tree=Try&rev=55aad1ec327e

Once results are green I'm going to land your patch.
Comment 29 Mihai Sucan [:msucan] 2013-02-26 10:55:54 PST
Landed the folded patch:
https://hg.mozilla.org/integration/fx-team/rev/b1ba5ea6168b
Comment 30 Frank Yan (:fryn) 2013-02-26 12:53:42 PST
Cory and Mihai, thank you for fixing this! :)
Comment 31 Tim Taubert [:ttaubert] (on PTO, back Aug 29th) 2013-02-26 16:02:46 PST
https://hg.mozilla.org/mozilla-central/rev/b1ba5ea6168b
Comment 32 maxlath 2014-01-24 05:23:53 PST
Hi, (I'm new to Bugzilla, excuse my question if I got something wrong)
so Ctrl+a has been map to Select All for Windows, but what is the situation on Linux? Neither Ctrl+a or Alt+a seem to be working. If there was no patch for the Linux case, shall I open a new bug or reopen this one with a different title?
Thanks in advance :)
Comment 33 Paul Rouget [:paul] 2014-01-24 05:30:47 PST
(In reply to k from comment #32)
> Hi, (I'm new to Bugzilla, excuse my question if I got something wrong)
> so Ctrl+a has been map to Select All for Windows, but what is the situation
> on Linux? Neither Ctrl+a or Alt+a seem to be working. If there was no patch
> for the Linux case, shall I open a new bug or reopen this one with a
> different title?
> Thanks in advance :)

Works for me on Linux.
Comment 34 maxlath 2014-01-24 06:04:51 PST
my mistake, the Alt key was catch by an addon, sorry to have bothered

Note You need to log in before you can comment on or make changes to this bug.