prompt-toolkit / prompt-toolkit/python-prompt-toolkit

Support terminal output color indexes

Open
#355 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Currently _color_to_code implements sophisticated support for vt100 terminal colors:

  1. Ansi names.
  2. 16 colors.
  3. 256 colors.
  4. True color.

What is missing is the possibility to directly pass the code. This is important since some people (like me, using base16 themes) customize the first 16 colors to their heart contents. I believe it's a very simple change: if color is an int simply return it as a code.

What do you think?

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Locate the _color_to_code implementation and read its existing handling for named, 16-color, 256-color, and true-color values. Confirm the surrounding terminal color tests or entry points, then verify that direct integer color codes are accepted without changing existing conversions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.