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

Add support for SetOutputMode other than OutputNormal for Windows Terminal #248

Open
AlejandroSuero opened this issue Jan 17, 2024 · 0 comments

Comments

@AlejandroSuero
Copy link

I am a bit new to golang so I am not sure how will it be possible to detect if the user is using Windows terminal instead of the cmd.

Windows terminal does support RGB, when using WSL I can use the colours from RGBToAttribute, but when I am using PowerShell it detects that I am using Windows so it outputs normal mode instead.

In WSL:

image

In PowerShell:

image

I want to achieve the same behaviour to get more control over colours.

This is the code I wrote for this behaviour:

// ... code

// setting tabs as '·' rune and using the a dark gray as foreground
termbox.SetCell(col, row, rune('·'), termbox.RGBToAttribute(62, 64, 66), termbox.ColorDefault)

// ...

// setting the output mode to RGB in the main loop
termbox.SetOutputMode(termbox.OutputRGB)

//...
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