Bug 31780

Summary: Web Inspector: Keyboard Shortcut to Clear Console Messages
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, keishi, pfeldman, pmuellr, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Cmd+K to Clear Console
timothy: review+
[PATCH] Cmd+K (Mac), Ctrl+L (Mac+Linux) to Clear Console
none
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console
pfeldman: review+
[PATCH] Cmd+K (Mac), Ctrl+L (All) to Clear Console Using KeyboardShortcut pfeldman: review+

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