From 8b8fcee00c294971fdca1b566cb912d73951d9a5 2010-09-10 16:14:40 From: epatters Date: 2010-09-10 16:14:40 Subject: [PATCH] Merge branch 'newkernel' of github.com:ipython/ipython into newkernel --- diff --git a/IPython/frontend/qt/console/frontend_widget.py b/IPython/frontend/qt/console/frontend_widget.py index 3f7b70a..873587c 100644 --- a/IPython/frontend/qt/console/frontend_widget.py +++ b/IPython/frontend/qt/console/frontend_widget.py @@ -324,7 +324,12 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): """ Handle stdout, stderr, and stdin. """ if not self._hidden and self._is_from_this_session(msg): - self._append_plain_text(msg['content']['data']) + # Most consoles treat tabs as being 8 space characters. Convert tabs + # to spaces so that output looks as expected regardless of this + # widget's tab width. + text = msg['content']['data'].expandtabs(8) + + self._append_plain_text(text) self._control.moveCursor(QtGui.QTextCursor.End) def _started_channels(self):