Agree, dumb terminals are not taken into account. We could run "tput colors" to query the capabilities instead of assuming that every tty has colors. Feel free to open an trac ticket and fix it...
On Thursday, January 2, 2014 6:54:19 PM UTC-10, Jskud wrote: > > Describe the desired result and the context of the problem. > > ================================================================ > > Run Sage from a dumb terminal (eg, from an Emacs shell with > ansi-color-for-comint-mode-off and TERM=dumb). You will see > unexpected terminal control characters around the prompt. > > Platform (CPU) and Operating System > ================================================================ > Fails running Sage 6.0 on RHEL 5.7 on multi-core Pentium. > > Fails running Sage 5.13 on Fedora release 16 (Verne) running on > Windows7 on multi-core Pentium using VirtualBox and downloaded image > > Exact version of Sage (command: "version()") > ================================================================ > 'Sage Version 5.13, Release Date: 2013-12-15' > > Provide copy-paste-ready reproducible commands causing the error > ================================================================ > > $ sage > sage: version() > > ==== you should see something like this ==== > > [[I've replaced the Esc control character with the two character ascii > representation (as Emacs would display it) "^[", and enabled > ansi-color midway through the example.]] > > ^[[0;34msage: ^[[0mversion() > ^[[0;31m^[[0m'Sage Version 5.13, Release Date: 2013-12-15' > sage: "ansi-color-for-comint-on" > 'ansi-color-for-comint-on' > sage: version() > 'Sage Version 5.13, Release Date: 2013-12-15' > sage: > > Other Information > ================================================================ > > I suspect this is caused by either Sage or iPython not checking the > TERM setting. This piece of code which sets colors = 'LightBG', may > be responsible; but of course, iPython could also be responsible for > doing the checking. > > [[~/sage-5.13/devel/sage-main/sage/misc/interpreter.py]] > > DEFAULT_SAGE_CONFIG = Config( > PromptManager = Config( > in_template = 'sage: ', > in2_template = '....: ', > justify = False, > out_template = ''), > TerminalIPythonApp = Config( > display_banner = False, > verbose_crash = True), > TerminalInteractiveShell = Config( > ast_node_interactivity = 'all', > colors = 'LightBG' if sys.stdout.isatty() else 'NoColor', > confirm_exit = False, > separate_in = ''), > # The extension is *always* loaded for SageTerminalApp > # See the code for SageTerminalApp.init_shell > #InteractiveShellApp = Config(extensions=['sage.misc.sage_extension']), > ) > > [] > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
