The Select All shortcut is broken on macOS
Related to #257
On macOS pressing the Cmd-A shortcut will always select the whole document bypassing the step that selects the cell.
The issue only happens when using the shortcut. Using the menu item directly works as expected: first it selects content of the cell, then it selects content of the console.
It likely happens, because QWidgetTextControl (private parent Qt class for QTextEdit and QPlainTextEdit) implements the Select All shortcut (which is resolved into key codes depending on the OS).
The solution I propose is:
- Remove conditional mapping in console_widget.py and mainwindow.py
- Reject Select All events coming into the control by adding
if obj == self._control and event == QtGui.QKeySequence.SelectAll: return True
The event will then be propagated properly into mainwindow and custom select all logic will be triggered.
Sounds good. Please submit a pull request and a test for it. Thanks!
@ccordoba12 I will, but I'd like to understand the need for https://github.com/jupyter/qtconsole/commit/478f2437cd6b48f156031a58969678a716646d40 and https://github.com/jupyter/qtconsole/commit/f2785541618a940ad74363e6b28d0a542e3c1a87a.
Could someone remove that code and test on Windows / Linux?