Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable color by default unless running in an interactive terminal #297

Open
nettrino opened this issue May 28, 2024 · 3 comments
Open

Disable color by default unless running in an interactive terminal #297

nettrino opened this issue May 28, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@nettrino
Copy link
Contributor

Description

With the current defaults escape characters appear on logs in most platforms making output harder to read

Screenshot 2024-05-28 at 11 17 41 AM
@nettrino nettrino added the enhancement New feature or request label May 28, 2024
@ee7
Copy link
Contributor

ee7 commented May 28, 2024

We currently try to disable color when stdout is not a tty:

chalk/src/util.nim

Lines 299 to 300 in b70a3fa

if isatty(1) == 0:
setShowColor(false)

I'll check if this needs to integrate better with the config, or e.g. the environment variables:

  • NO_COLOR existing
  • or TERM having the value DUMB.

@viega
Copy link
Contributor

viega commented May 28, 2024 via email

@miki725
Copy link
Contributor

miki725 commented May 28, 2024

chalk/src/chalk.nim

Lines 13 to 19 in afa0934

when isMainModule:
setupSignalHandlers() # util.nim
setupTerminal() # util.nim
ioSetup() # sinks.nim
loadAllConfigs() # confload.nim
recursionCheck() # norecurse.nim
otherSetupTasks() # util.nim

should be getting called last

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants