Comments (3)
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.
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.
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)
- Signal handling (Ctrl+C / Ctrl+D) Support in Dialoguer HOT 1
- Is it possible to have a simple `Passphrase:` prompt?
- Examples link is invalid HOT 1
- Support Keys: Home, End, Del for `Input::interact_text_on`
- `IoError: read interrupted` and messed-up terminal while using `ctrl-c` and a prompt is active HOT 2
- Logging when a prompt is open
- History is not available for import HOT 1
- In tmux session content is pasted multiple times HOT 1
- Don't impose colon on prompt format
- Confirm dialogue doesn't work with non latin alphabet characters HOT 4
- In `Input`, cursor behavior is buggy when deleting a character when `with_prompt()` contains a newline HOT 1
- Use of moved value `confirm` HOT 5
- Select with default on second page shows first page
- Multiselect example doesn't work: selection is never re-rendered HOT 2
- Feature request: option for newline for `Input`
- Feature suggestion: prompt timeouts HOT 1
- BUG - Input with utf8 chars HOT 1
- Password prompt freezes program when a long password is entered HOT 4
- Unable to change selection of a Select in certain terminals.
- Feature: Tab to select line and move down HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialoguer.