Summary: | Web Inspector: cannot type Option-D with certain keyboard layout in console | ||
---|---|---|---|
Product: | WebKit | Reporter: | i |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | ap, inspector-bugzilla-changes, qianlangchen, rcaliman, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 17 | ||
Hardware: | Mac (Intel) | ||
OS: | macOS 14 |
Description
i
2024-03-06 09:49:32 PST
I think that this can be reproduced even without installing this keyboard. With U.S. keyboard, Option-D normally produces "∂", but nothing in Web Inspector console. (In reply to Alexey Proskuryakov from comment #1) > I think that this can be reproduced even without installing this keyboard. > With U.S. keyboard, Option-D normally produces "∂", but nothing in Web > Inspector console. You are right. I use new AZERTY as example because being able to input dollar sign is more important for debugging in console. (In reply to Alexey Proskuryakov from comment #1) > I think that this can be reproduced even without installing this keyboard. > With U.S. keyboard, Option-D normally produces "∂", but nothing in Web > Inspector console. The Console prompt uses the Codemirror editor. Option-D (aka Alt-D) is a keyboard shortcut which deletes text from the cursor to the end of the word: https://github.com/WebKit/WebKit/blob/fbe4a30494efb2f9a31d2a6c2866780889869737/Source/WebInspectorUI/UserInterface/External/CodeMirror/codemirror.js#L6321 There are many other keyboard shortcuts which will run editor actions instead of typing in a character. The reason you don't see the effect is probably because you're trying to type the dollar sign at the start of an empty line. I don't know if Web Inspector can detect keyboard layout. It's not appropriate to have letter combinations with Option perform commands on macOS with any keyboard layout, those are all in use. I see that Option+B and Option+F are also broken. The comment in code saying "which are standard on Mac" is incorrect. (In reply to Razvan Caliman from comment #4) > (In reply to Alexey Proskuryakov from comment #1) > > I think that this can be reproduced even without installing this keyboard. > > With U.S. keyboard, Option-D normally produces "∂", but nothing in Web > > Inspector console. > > The Console prompt uses the Codemirror editor. > > Option-D (aka Alt-D) is a keyboard shortcut which deletes text from the > cursor to the end of the word: > > https://github.com/WebKit/WebKit/blob/ > fbe4a30494efb2f9a31d2a6c2866780889869737/Source/WebInspectorUI/UserInterface/ > External/CodeMirror/codemirror.js#L6321 > > There are many other keyboard shortcuts which will run editor actions > instead of typing in a character. > > The reason you don't see the effect is probably because you're trying to > type the dollar sign at the start of an empty line. > > I don't know if Web Inspector can detect keyboard layout. I found a GitHub issue in CodeMirror's repo that addresses the same problem: https://github.com/codemirror/codemirror5/issues/6630 Option-D, Option-F and Option-B are legacy emacs shortcuts that no longer work on modern Macs. CodeMirror already removed Option-D, Option-F and Option-B bindings in https://github.com/codemirror/codemirror5/pull/6631, so the latest CodeMirror does not have this problem. > I found a GitHub issue in CodeMirror's repo that addresses the same problem: > https://github.com/codemirror/codemirror5/issues/6630 > > Option-D, Option-F and Option-B are legacy emacs shortcuts that no longer > work on modern Macs. > > CodeMirror already removed Option-D, Option-F and Option-B bindings in > https://github.com/codemirror/codemirror5/pull/6631, so the latest > CodeMirror does not have this problem. The CodeMirror we have does seem to be older and didn't include that remove of Option-based shortcuts: https://github.com/WebKit/WebKit/blob/d43c60471f2017c175a36146c61d36c6f104d244/Source/WebInspectorUI/UserInterface/External/CodeMirror/codemirror.js#L6319-L6321 |