realn2s,

After it worked like a charm the last time, another question. (Please boost for reach)

How can I (temporarily) disable all color output on a command line?

Background: I try to work in a sunny environment. Maximizing screen brightness it basically works fine BUT some command color their output (git, rail, ...). And blue or red output is very hard to read on the black background.

A had hoped that an
export TERM=xterm-mono
would do the trick, but sadly not.

Any ideas on how to accomplish this are welcome
(I would like to avoid switching of color output for each command separately so 😠 )

multiplex,
@multiplex@hachyderm.io avatar

@realn2s this is an xterm? I set all accent colors in the terminal emulator to white.

rrq,

@realn2s
"xterm -cm" turns off color mode in that xterm, but I'm not sure there is an environment variable to do it for "the current" xterm.

realn2s,

@rrq
I don't think so. But it would be acceptable to start a new xterm in these conditions
🙏🏻

As I usually use the Ubuntu default gnome-terminal I will check if it supports a similar option. But i would even install xterm for this

willmurphy,

@realn2s A lot of command line tools respect the NO_COLOR environment variable. Not perfect but might help a lot. https://no-color.org/

realn2s,

@willmurphy
🙏🏻​ and 😠

Both git as well als rails seem to ignore NO_COLOR

coderbyheart,
@coderbyheart@chaos.social avatar

@realn2s I don't think this is possible globally, because shell colors are done use extra escape sequences which are included in the command output. But I guess you could use ansi2txt from https://github.com/kilobyte/colorized-logs to remove those escape sequences.

realn2s,

@coderbyheart
🙏🏻 That is a feasibly workaround if the output is not readable

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux
  • DreamBathrooms
  • mdbf
  • tacticalgear
  • magazineikmin
  • thenastyranch
  • rosin
  • everett
  • Youngstown
  • khanakhh
  • slotface
  • ngwrru68w68
  • kavyap
  • cisconetworking
  • InstantRegret
  • megavids
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • tester
  • Durango
  • normalnudes
  • anitta
  • modclub
  • cubers
  • Leos
  • provamag3
  • JUstTest
  • lostlight
  • All magazines