From 4ca46a4f449c106348e48047389cf0f9887840c1 2006-01-15 20:44:24 From: vivainio Date: 2006-01-15 20:44:24 Subject: [PATCH] Do not attempt to set term title in non-xterm workalikes (at least linux character console malfunctions). --- diff --git a/IPython/platutils_posix.py b/IPython/platutils_posix.py index 387504d..ef80ad6 100644 --- a/IPython/platutils_posix.py +++ b/IPython/platutils_posix.py @@ -21,6 +21,20 @@ __author__ = '%s <%s>' % Release.authors['Ville'] __license__ = Release.license import sys +import os -def set_term_title(title): + +def _dummy_op(*a, **b): + """ A no-op function """ + +def _set_term_title_xterm(title): + """ Change virtual terminal title in xterm-workalikes """ sys.stdout.write('\033]%d;%s\007' % (0,title)) + + +if os.environ.get('TERM','') == 'xterm': + set_term_title = _set_term_title_xterm +else: + set_term_title = _dummy_op + +