Bug 31780 - Web Inspector: Keyboard Shortcut to Clear Console Messages
Summary: Web Inspector: Keyboard Shortcut to Clear Console Messages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-21 23:50 PST by Joseph Pecoraro
Modified: 2009-11-24 09:56 PST (History)
7 users (show)

See Also:


Attachments
[PATCH] Cmd+K to Clear Console (1.58 KB, patch)
2009-11-21 23:53 PST, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff
[PATCH] Cmd+K (Mac), Ctrl+L (Mac+Linux) to Clear Console (2.49 KB, patch)
2009-11-22 09:03 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console (1.90 KB, patch)
2009-11-22 09:14 PST, Joseph Pecoraro
pfeldman: review+
Details | Formatted Diff | Diff
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console Using KeyboardShortcut (7.29 KB, patch)
2009-11-24 09:34 PST, Joseph Pecoraro
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-11-21 23:50:52 PST
Suggestion is ⌘K like it is in Terminal.app:
http://twitter.com/gnb/status/5941003857

> A request: a keyboard shortcut to clear the console. Perhaps ⌘K as in Terminal.app?

Any idea what this should be for Windows?
Comment 1 Joseph Pecoraro 2009-11-21 23:53:21 PST
Created attachment 43673 [details]
[PATCH] Cmd+K to Clear Console

Assigns ⌘K to Clear Console Messages for Mac Users.
Comment 2 Pavel Feldman 2009-11-22 05:59:16 PST
> Any idea what this should be for Windows?

I don't think such a thing exists on Windows. Maybe Ctrl + K ?
Comment 3 Pavel Feldman 2009-11-22 06:17:52 PST
While we are thinking about the shortcut...

Should we make typing "clear" do the job? Currently you need to do "clear()" and it leaves "undefined" result as a trace. Not nice.
Comment 4 Timothy Hatcher 2009-11-22 08:33:35 PST
I think a shortcut is fine.

I don't think it can be Control-K on Windows, that might trigger the kill-to-end-of-line editing command (like it does on Mac).
Comment 5 Joseph Pecoraro 2009-11-22 09:03:29 PST
Created attachment 43678 [details]
[PATCH] Cmd+K (Mac), Ctrl+L (Mac+Linux) to Clear Console

It appears as though Ctrl+L means the same thing. This is likely to be a good thing for Linux users. Mac Users have this too (works in Terminal.app). Source:
http://www.tuxfiles.org/linuxhelp/shortcuts.html
Comment 6 Joseph Pecoraro 2009-11-22 09:14:04 PST
Created attachment 43681 [details]
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console

Chat on IRC sounded like Ctrl+L should be for all platforms. Don't single out Windows.
Comment 7 Pavel Feldman 2009-11-22 09:36:39 PST
Comment on attachment 43681 [details]
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console

I think we should somehow reuse what is in KeyboardShortcuts.js (or improve it or stop using it if it is not useful in all places). Overall, shortcuts framework is often useful.
Comment 8 Joseph Pecoraro 2009-11-24 09:34:14 PST
Created attachment 43776 [details]
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console Using KeyboardShortcut

Using the KeyboardShortcut lib
Comment 9 Pavel Feldman 2009-11-24 09:41:33 PST
Comment on attachment 43776 [details]
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console Using KeyboardShortcut

> +    var shortcut;

Move this lower?

> +            if (!this._shortcuts[shortcut].isMacOnly || WebInspector.isMac()) {

We could make this logic a part of the makeKeyFromEvent, no?
Comment 10 Joseph Pecoraro 2009-11-24 09:56:06 PST
(In reply to comment #9)
> (From update of attachment 43776 [details])
> > +    var shortcut;
> 
> Move this lower?

Done.

> > +            if (!this._shortcuts[shortcut].isMacOnly || WebInspector.isMac()) {
> 
> We could make this logic a part of the makeKeyFromEvent, no?

Like you mentioned in IRC, this could move to a Modifier, or something like that. But we decided to leave it for now.

Landed in http://trac.webkit.org/changeset/51341
r51341 = 8b54f6e271ac7bb77580c41b7b6ffd1d65c29cd8