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

TTY settings: way to include colors but not curses? #8193

Closed
kevinburke opened this issue Jul 31, 2017 · 4 comments
Closed

TTY settings: way to include colors but not curses? #8193

kevinburke opened this issue Jul 31, 2017 · 4 comments
Labels

Comments

@kevinburke
Copy link

kevinburke commented Jul 31, 2017

I believe Travis pretends to be a TTY so that colors render correctly in the build.

However this breaks for applications that use curses - Travis can't handle these and appends a new line each time the line is redrawn. See for example here: https://travis-ci.org/kevinburke/rest/builds/256303499

You get output like:

INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (29\/ 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (25\7 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (49\6 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (799 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (10\08 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (12\32 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (15\08 / 2233)
INFO: Cloning https://github.com/bazelbuild/rules_go.git: Resolving deltas (19\

That's using Bazel, which uses the presence of a tty to infer that it can show progress messages (and colors). So right now using Bazel you have to run that and then get the bad output and then dig through the settings (there are lots of settings) to find and enable --noshow_progress and other settings. It would probably be preferable to disable colors (and progress messages) if we had to choose between colors and curses/progress messages.

Is there a specification or a standard for setting TTY or no in your .travis.yml or a specification for telling the running program, "I can handle ANSI escape sequences but not curses"?

Previously, previously, previously, previously.

@BanzaiMan
Copy link
Contributor

As far as the terminal is concerned, there is no difference between "colors" and "curses", as you describe them; they are all ANSI escape sequences. The receiving terminal may choose to render these sequences in any way it sees fit.

Our logs are stream oriented; which means that certain escape sequences that aim to modify the cursor position on the screen (which progress bars and such tend to use) are really bad news.

@ssbarnea
Copy link

ssbarnea commented Apr 2, 2018

I have the same problem as I find the progressbars from travis extremely annoying (and affecting web console load performance). Poor travis has no fault in this, this being purely pip fault which seems to be the only tool that display progress information when running in quiet mode (--quiet/-q).

Few people recommended using | cat as a trick to disable the progressbar but this would be very ugly, especially if user would have to perform some hideous changes to their tox.ini files:

Before workaround

commands =
    pip install -q ...

After workaround

commands =
    bash -c "pip install -q ... | cat"

@stale
Copy link

stale bot commented Jul 1, 2018

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues

@stale stale bot added the stale label Jul 1, 2018
@stale stale bot closed this as completed Jul 2, 2018
@strk
Copy link

strk commented Oct 16, 2019

Hey, I'm looking for a solution as well. How to tell Travis NOT to behave as a tty ?

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

4 participants