Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

prettyprint should have option for light terminal #5

Closed
TedDriggs opened this issue Jan 24, 2019 · 4 comments
Closed

prettyprint should have option for light terminal #5

TedDriggs opened this issue Jan 24, 2019 · 4 comments

Comments

@TedDriggs
Copy link

On macOS, the default terminal is black text on a white background (and since I have difficulty seeing red-on-black, I prefer to keep it that way). As a result, when cargo-expand uses prettyprint, certain syntax elements become invisible white-on-white text that renders the output unusable.

screen shot 2019-01-24 at 8 32 08 am

Options

  1. Somehow detect the terminal background color and choose a contrasting color for primary text. Doing this in a cross-platform way might be difficult.
  2. Add an option for callers to tell prettyprint to use a light theme vs a dark theme. This would require cargo-expand and others to expose a command-line flag of their own to choose light vs dark, but it would avoid reading anything from the terminal.
@mre
Copy link
Owner

mre commented Jan 24, 2019

This can be done already. Prettyprint supports all colorschemes that syntect supports. So it might be as easy as sending a pull request to cargo-expand (or cargo-inspect, which is also using prettyprint) and add the flag as well as choose a colorscheme.

@mre
Copy link
Owner

mre commented Jan 24, 2019

And yes I agree, the screenshot looks quite awful. 😀

@mre mre changed the title prettyprint shouldn't have option for light terminal prettyprint should have option for light terminal Feb 5, 2019
@mre
Copy link
Owner

mre commented Feb 5, 2019

This is now done in cargo-inspect thanks to @jonathansty.
See the release notes here.
It uses prettyprint 0.4.0, which has support for the get_themes method. See here.

I think we can close this. 🎉

@mre mre closed this as completed Feb 5, 2019
@mre
Copy link
Owner

mre commented Feb 5, 2019

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants