Giter Site home page Giter Site logo

Comments (3)

pksunkara avatar pksunkara commented on June 29, 2024 1

The colors are switched on if a TTY is found. I am not exactly sure what happened with env -i [binary].

I think the best solution here is to edit the rendering of multi-select in ColorfulTheme.

from dialoguer.

Ekleog avatar Ekleog commented on June 29, 2024

Actually I found a bypass myself: using console::colors_enabled() to automatically dispatch between ColorfulTheme and SimpleTheme.

This being said… I wonder whether this should not be done upstream? If only so that people with screenreaders (who… hopefully can use the SimpleTheme? I'm not sure) could use programs made by people who didn't think of this case and just used ColorfulTheme without giving it a second thought.

from dialoguer.

Ekleog avatar Ekleog commented on June 29, 2024

I'd guess the reason why env -i makes coloring fail is because it loses the TERM variable and thus means that terminfo can't be found. As for auto-TTY-detection… I must say that I'm not sure it works? Using env -i does trigger my workaround based on console::colors_enabled() and generate a SimpleTheme, so I'd guess something that is not console::colors_enabled() is being used if there's already TTY detection supposed to happen.

This being said, your proposed solution does sound great to me too :)

from dialoguer.

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.