Giter Site home page Giter Site logo

Comments (2)

flagarde avatar flagarde commented on August 10, 2024 1

Maybe this could be integrated https://github.com/agauniyal/termdb

from cpp-terminal.

MCWertGaming avatar MCWertGaming commented on August 10, 2024

I have done some research on this and there are almost no terminals that are not supporting 4 or 8 bit colors. Problem as we already know is the 24bit color support. We could use one or more of the following methods to determine true color support:

  • windows
    -> Powershell 5 (windows build in), Powershell 7 ("Powershell core", can be installed manually and is cross plattform), CMD, WSL/WSL2 and the microsoft opensource terminal support true color starting with windows 10. I guess that we can simply check the operating system version and disable true color if it's windows 8.1 or below
    -> old windows shells (cmder, PuTTY, probably others) don't support true color, my thing here is that i'm not sure if they are even used anymore / if they are still developed or already dead projects
    -> Termus has no true color support and probably wont have it at all because it's propritary - i'm not sure yet what we could do about this one, Kitty doesn't have it either

  • linux
    -> Most terminal support already true color (Kitty, vscode integrated terminal, xterm, deepin-terminal, gnome-terminal, terminator and many more) and maybe even all have the $COLORTERM variable set to "truecolor" or "24bit" so they are easily detectable
    -> variables won't be passed through ssh, so we probably need something for that case
    -> there are still some Terminal that don't support 24bit colors (Terminus, gtk2term and some others) but they are not that much and many look abonded
    -> Maybe some terminal support 24bit colors but don't set the COLORTERM variable
    -> I'd suggest to only support consoles that are still supported by their authors and would use 8bit colors by default for everything, but turn on 24bit colors if the COLORTERM variable is set. Also we can (and probably have to) add extra checks for specific terminals like using the $TERM variable wich contains the Terminal name
    -> There is also the terminfo file wich contains informations about specific terminals, but i think that would be far more complicated than just checking $COLORTERM

  • macos
    -> default terminal does not have true color support
    -> maybe it doesn't set the TRUECOLOR variable, then it would be no issue at all
    -> Kitty etc have true color support

  • unix / *BSD
    -> the default bsd terminal has no true color support but might also not set the COLORTERM variable, then same as at macos
    -> not sure, if BSD has other terminals at all? Might require a research...

  • other systems
    -> Android will be like linux

I'll do a small demo on this the next days and do a small overview here then. The implementation will happen after #116 was merged. Also it would be great if @certik could check if the macos default terminal sets the COLORTERM variable and if yes what's stored inside and what's included in the $TERM variable. Also are there terminals that are really important besides the default ones?

from cpp-terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.