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

escape sequences don't work on terminal output #38

Closed
noelbush-xx opened this issue Mar 25, 2012 · 3 comments
Closed

escape sequences don't work on terminal output #38

noelbush-xx opened this issue Mar 25, 2012 · 3 comments
Labels

Comments

@noelbush-xx
Copy link

When running Behave in Gnome Terminal (the standard terminal in Ubuntu), or in xterm, the escape sequence for "up" doesn't display right. Instead, it looks like:

Scenario: run a simple test # example.feature:3
Given we have behave installed # steps/example.py:3
�[#1A Given we have behave installed # steps/example.py:3
When we implement a test # steps/example.py:7
�[#1A When we implement a test # steps/example.py:7
Then behave will test it for us! # steps/example.py:11
�[#1A Then behave will test it for us! # steps/example.py:11

(Before the "[" there is one of those numbered/boxy symbols indicating a control character, but that doesn't copy/paste properly, of course.)

In "screen" or rxvt, the terminal output is right (the "grey" line is replaced by the "green" line when the step passes). So obviously this is an issue with differences in escape sequences between terminals.

I've looked around to try to figure out how to redefine this "up" command (it's cuu or cuu1) on my terminal, but I can't figure it out. And of course I don't really want to switch terminals just to use behave. Any ideas how to address this?

@jenisys
Copy link
Member

jenisys commented Mar 25, 2012

The ANSI escape sequence for "up" should be correct (AFAIK).
I expect the terminal setting may be wrong. Check the TERM environment variable (and so).
NOTE: I works fine for me under MACOSX with TERM=xterm-256color (default settings).

WORKAROUND:
If this behavior annoys you, switch off coloring for now or use the plain formatter (has no coloring).

I am looking into this issue for Windows.
Because colorama (that could be used for coloring under Windows) does not translate the "up" sequence to the CMD shell.

@noelbush-xx
Copy link
Author

Well, I submitted a little tiny pull request that fixes this for me, and also works in a few other terminals I tried.

I would like to keep the pretty coloring -- it's nice.

This same problem happens for all my co-workers. So I wonder what terminal you are using -- must be something rather unusual/exotic.

If the change I submitted (just removing a "#") does not break the behavior for you, then it would be nice if you could incorporate it.

jenisys added a commit to jenisys/behave that referenced this issue Apr 9, 2012
@jeamland
Copy link
Contributor

I've applied @noelbush's pull request. Thanks!

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

3 participants