Skip to content

Commit

Permalink
Merge pull request #447 from impact27/patch-2
Browse files Browse the repository at this point in the history
Copy text if text is selected
  • Loading branch information
ccordoba12 committed Oct 20, 2020
2 parents 55f0c06 + 6312f9f commit 202be75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qtconsole/frontend_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ def _event_filter_console_keypress(self, event):
if self._control_key_down(event.modifiers(), include_command=False):

if key == QtCore.Qt.Key_C and self._executing:
self.request_interrupt_kernel()
# If text is selected, the user probably wants to copy it.
if self.can_copy() and event.matches(QtGui.QKeySequence.Copy):
self.copy()
else:
self.request_interrupt_kernel()
return True

elif key == QtCore.Qt.Key_Period:
Expand Down

0 comments on commit 202be75

Please sign in to comment.