CLI doesn't support ansi terminals with 3-bit colors

Open
#323 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Run tput colors in an 8-color terminal and read pulpcore/cli/common/context.py at the formatter setup referenced in the issue. Compare the color handling with the linked httpie implementation. Done means the CLI adapts to the terminal's available colors or disables color when 256-color output is unsupported.

Written by the indexing model from the issue text.

Description

feature request

A user on the pulp channel ran into a problem where their text was blinking. The command tput colors showed that their terminal only support 8 colors.

We're using a 256 color formatter (see here). I think we need to make the CLI smarter and have it fall back to use the colors the terminal provides or automatically disable color support if the terminal doesn't have 256 colors.

A quick scan of httpie looks like maybe it handles this: https://github.com/httpie/httpie/blob/464b5b4c1d8b3e72255739094e17a013d80abae7/httpie/output/formatters/colors.py#L57-L66

Dominant language
Python
Stars
43
Forks
52
Avg merge
11h 38m
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pulp/pulp-cli

All issues in pulp/pulp-cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.