From 92971904bc9fd2b988d8c16e9502edc39a70ff25 2010-09-07 05:46:20 From: Fernando Perez Date: 2010-09-07 05:46:20 Subject: [PATCH] Fix paste bug where trailing newlines required a manual backspace. --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 03b09fa..d78cd63 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -419,7 +419,9 @@ class ConsoleWidget(Configurable, QtGui.QWidget): """ if self._control.textInteractionFlags() & QtCore.Qt.TextEditable: try: - text = str(QtGui.QApplication.clipboard().text(mode)) + # Remove any trailing newline, which confuses the GUI and + # forces the user to backspace. + text = str(QtGui.QApplication.clipboard().text(mode)).rstrip() except UnicodeEncodeError: pass else: