Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: terminal color coding doesn't work under cmd.exe #10

Closed
dangthill opened this issue Mar 28, 2012 · 2 comments
Closed

Windows: terminal color coding doesn't work under cmd.exe #10

dangthill opened this issue Mar 28, 2012 · 2 comments
Labels

Comments

@dangthill
Copy link

When running under cmd.exe (CPython 2.7.2 on Windows XP 64), the color escape codes aren't interpreted and make debug output rather messy. I ended up just commenting out:

#if color in _colors:
#    msg = '%s%s%s' % ("\x1b["+_colors[color]+(";1" if bold else "")+"m", msg, "\x1b[0m")

in ui.py to get going. I'm not aware of the coding necessary for cmd.exe, so perhaps it's easiest to just check the SHELL environment variable or os.name and disable it.

@tonyduckles
Copy link
Owner

Interesting. I could've sworn that back in the MS-DOS days the command prompt fully supported the ANSI escape sequences. Based on some quick searching, it sounds like that's no longer the case:
http://stackoverflow.com/questions/6532295/ansi-escape-sequences-not-working-in-windows-cmd-prompt

I'll probably conditionalize this based on os.name, like some other OS-specific handling in shell.py.

@tonyduckles
Copy link
Owner

Fixed in f1919fc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants