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

TB_OUTPUT_256: Cannot use black / write CSI 38;5;0 #114

Open
ljrk0 opened this issue Apr 15, 2018 · 0 comments
Open

TB_OUTPUT_256: Cannot use black / write CSI 38;5;0 #114

ljrk0 opened this issue Apr 15, 2018 · 0 comments

Comments

@ljrk0
Copy link

ljrk0 commented Apr 15, 2018

The current implementation treats the value 0 (=TB_DEFAULT) for fg/bg special in write_sgr(). This leads to much unexpected behavior, for once, one cannot use the TB_* constants with this mode anymore.

Color TB_OUTPUT_NORMAL TB_OUTPUT_256
clear 0 0
black 1 -
red 2 1
... ... ...

What seems to be the most sensible but also most radical solution to me would be:

  1. Make the TB_* constants line up with the actual values used ain SGR, ie. 0 for black etc.
  2. Set TB_DEFAULT to a different magic value that's not used anywhere and catch that, if we are breaking, we could actually use -1 and use int16_t instead.
  3. In fact, if we wanted to at some point support truecolor, we should perhaps even make it a bigger value.

Also I've found that the code uses the TB_BOLD constant for bg to encode "blinking", which should be documented.

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

No branches or pull requests

1 participant