Skip to content

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

Open
@AlejandroSuero

Description

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)

//...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions