FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve legibility on light-background terminals by dlitz · Pull Request #152 · samuelcolvin/python-devtools · GitHub

Improve legibility on light-background terminals - #152

Open
dlitz wants to merge 1 commit into
samuelcolvin:mainfrom
dlitz:lightbg
Open

Improve legibility on light-background terminals#152
dlitz wants to merge 1 commit into
samuelcolvin:mainfrom
dlitz:lightbg

Conversation

dlitz commented Apr 19, 2024
edited
Loading

Copy link
Copy Markdown

This fixes the problem of light-gray text being rendered on a light background.

Users can now choose a different Pygments style/theme using the PY_DEVTOOLS_STYLE environment variable.

If PY_DEVTOOLS_STYLE is not set, we attempt auto-detection using the COLORFGBG environment variable, as is commonly done by some tools on Linux and macOS.

  • Dark-background terminals use the "vim" style, as before.
  • Light-background terminals now use the "sas" style.
  • If auto-detection fails, we use the "default" style, which is legible on most terminals.

A list of available styles can be obtained by running:

import pygments.styles
list(pygments.styles.get_all_styles())

Screenshots

Light background (COLORFGBG=0;15)

Before After

Dark background (COLORFGBG=15;0)

Before After

Indeterminate (COLORFGBG missing or unparsable)

Dark Background Light Background

dlitz force-pushed the lightbg branch 2 times, most recently from b371fbd to 248f6c5 Compare April 19, 2024 02:21
This fixes the problem of light-gray text being rendered on a light
background.

Users can now choose a different Pygments style/theme using the
PY_DEVTOOLS_STYLE environment variable.

If PY_DEVTOOLS_STYLE is not set, we attempt auto-detection using the
COLORFGBG environment variable, as is commonly done by some tools on
Linux and macOS.

- Dark-background terminals use the "vim" style, as before.
- Light-background terminals now use the "sas" style.
- If auto-detection fails, we use the "default" style, which is legible
  on most terminals.

A list of available styles can be obtained by running:

    import pygments.styles
    list(pygments.styles.get_all_styles())

dlitz commented Apr 19, 2024

Copy link
Copy Markdown
Author

Fixed the commit message & CI builds.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL