ansi icon indicating copy to clipboard operation
ansi copied to clipboard

Deactivation switch for ANSI color

Open trans opened this issue 15 years ago • 3 comments

There needs to be a way to globally deactivate ANSI coloring.

trans avatar Dec 27 '10 19:12 trans

Should this effect all codes including moving the cursor, or just effect colorization codes?

trans avatar May 07 '11 15:05 trans

This has been implemented with $ansi global variable. It will work in almost all cases. But there are still a few edge cases that will need address in the future, and also it doesn't effect BBCode yet b/c that lib still needs to be fully integrated with ANSI::Code.

trans avatar Nov 10 '11 00:11 trans

It has been pointed out to me that it would probably be better if a global wasn't set by default. For that to work there are two options.

  1. Either $ansi = nil would have to be equivalent to $ansi = true and only setting it specifically to false would deactivate it. That'll work but it is a bit odd to have nil === true.
  2. Or we need to use a $noansi (or $no_ansi) global instead.

Both cases may cause backward compatibility issues --the later more so than the former. So does the benefit out way the downside of change?

trans avatar Jan 06 '15 17:01 trans