This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This bug is a replica of CR 6657950("dbx console should not intercept NB debugging hotkeys like F7 and F8") as now it should be fixed in NB. Steps to reproduce: - create any sample e.g. Quote - set Internal terminal as a Console type - do Step into - press F8 (Step Over), step over is performed - set focus on Internal terminal tab (click mouse on Quote(Debug) tab in Output window) - press F8 (Step Over) Result: Nothing happens.
*** Bug 30564 has been marked as a duplicate of this bug. ***
Well, it turns out this isn't that easy to do. The terminals fundamental job is to pass all keystrokes on to the underlying application. Therefore it consumes all keyboard events. However, since it's early days Term has had a facility to allow specifying which Keystrokes to not consume so they could be intercepted by other mechanisms. So, for example one can do passKeystrokes.add(KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0)); term.setKeyStrokeSet((HashSet) passKeystrokes); (This was working poorly/misunderstood. See bug #185756) So it should simply be a matter of passing all of NB's global keystrokes to Term via this setKeyStrokeSet. But it's not that simple. 1) It turns out the global NB keymap is not available. One can Lookup Keymap and get it's implementation, NbKeymap. But NbKeymap doesn't implement getBoundKeyStrokes() and many other methods of Keymap. It seems to only provide a context-specific keystroke to action map. It only minimally implements Lookup so one cannot get notifications via Lookup.Result either Maybe there's another way but I haven't discovered it yet. 2) Suppose we could get the whole Keymap and tell Term about it, but do we want to? What if there's some sequence that a vi or emacs or midnight-commander running under the terminal needs to see? The fancy solution would be to provide a UI for alllowing the user to choose what to pass thru and what not. I believe Ernie Rael's vi plugin ran into a similar problem and vi settings have such tables. There's prolly not enough time to create such a table and it's UI for 6.9. I _could_ hard-code some common and important accelerators directly into Terminal, but I'm not very comfortable with hard-coding things. Or one can create a table managed by terminal options which has no knowledge of NB's default keymap and just allows users to control which keystrokes Term shouldn't consume.
There is no way of knowing which keystrokes an application run in term might actually need; surely it would be common for these to overlap with NB global accelerators. Recommend just having some simple way for the user to pass through keys to the container. For example, VirtualBox lets you define a host key (I use Right Shift) after which the container receives keystrokes. More to the point, Emacs does this in its M-x terminal-emulator mode.
JG: There is no way of knowing which keystrokes an application run in term might JG: actually need; indeed. JG: For example, VirtualBox lets you define a host JG: key (I use Right Shift) after which the container receives keystrokes. You mean as a mode or a prefix/escape? In either case it would sort-of defeat the purpose of accelerators. The bug summary talks about stepIn/StepOver ... who wants to escape those?
(In reply to comment #4) > You mean as a mode or a prefix/escape? Yes, probably as a mode. > In either case it would sort-of defeat the purpose of accelerators. > The bug summary talks about stepIn/StepOver ... who wants to escape those? I don't think e.g. Right-Shift F8 is much worse than F8, especially if the escape were truly modal (so you would only need to press it once after having used term for a while). Or just have some key sequence in term which makes it lose focus.
should be fixed in 6.10
fixed in: http://hg.netbeans.org/cnd-main/rev/6b527d398a1e now we use _global_ keymap for all keystrokes in the terminal, there is an option in global terminal options to disable that.
Integrated into 'main-golden', will be available in build *201105070000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6b527d398a1e User: Egor Ushakov <gorrus@netbeans.org> Log: fixed #185483 (Handle global shortcuts in the terminal)
new implementation in: http://hg.netbeans.org/releases/rev/0baca1c47319 actions allowed in the terminal are now specified in a folder: Terminal/Shortcuts any developer can add/remove actions from there. I expect someone to create a nice GUI plugin for this someday. As for now we have only debug/run main project and debugger step into/over actions specified.
also I expect developers to register actions if they want them to work in the terminal in their module's layer files.
also implemented a listener to monitor shortcuts folder changes: http://hg.netbeans.org/releases/rev/219a9cf3a991
Integrated into 'main-golden', will be available in build *201105200400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/4849d363bcee User: Egor Ushakov <gorrus@netbeans.org> Log: fixed #185483 (global shortcuts in the terminal) - predefined actions (transplanted from 0baca1c473195048b39f80d3e605160895953799)
Integrated into 'main-golden', will be available in build *201105210400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d5fe262a8315 User: Egor Ushakov <gorrus@netbeans.org> Log: fixed #185483 (global shortcuts in the terminal) - listen to the shortcuts folder changes (transplanted from 219a9cf3a99186d5d2ceba1a80e3fa3d0efb6299)