chshersh / iris

🌈 Haskell CLI Framework supporting Command Line Interface Guidelines
https://hackage.haskell.org/package/iris
Mozilla Public License 2.0
176 stars 21 forks source link

Detect non-interactive terminals automatically #58

Closed chshersh closed 1 year ago

chshersh commented 2 years ago

Currently, it's possible to disable interactivity by specifying the --no-input options. But some terminals are non-interactive by nature (e.g. on CI). So it would be great to check this and specify the value of InteractiveMode automatically.

german1608 commented 1 year ago

Would checking the $- environment variable suffice?

marcellourbani commented 1 year ago

I believe one should use hSupportsANSI from ansi-terminal

marcellourbani commented 1 year ago

will have a go

chshersh commented 1 year ago

Checking $- is a valid option. But it would be nice to have a cross-platform solution.