diff --git a/IPython/frontend/qt/console/ipython_widget.py b/IPython/frontend/qt/console/ipython_widget.py index 1c074b5..c217bd7 100644 --- a/IPython/frontend/qt/console/ipython_widget.py +++ b/IPython/frontend/qt/console/ipython_widget.py @@ -267,9 +267,9 @@ class IPythonWidget(FrontendWidget): """ Copy the currently selected text to the clipboard, removing prompts if possible. """ - if self.layout().currentWidget() == self._page_control : + if self._page_control.hasFocus() : self._page_control.copy() - elif self.layout().currentWidget() == self._control : + elif self._control.hasFocus() : text = self._control.textCursor().selection().toPlainText() if text: lines = map(transform_ipy_prompt, text.splitlines())