Skip to content
Snippets Groups Projects
Commit 23594275 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Remove support for mIRC color codes.

They tend to produce unwanted effects when an mIRC code is directly
followed by a text digit (which is going to happen often in this context, e.g.
with git hex commit IDs). the mIRC codes have no end delimiter, so
unless the client's recognizer is very carefully crafted it will eat
following text.
parent 440c49b6
No related branches found
No related tags found
No related merge requests found
......@@ -104,23 +104,19 @@ class GenericExtractor:
self.filtercmd = None
# Color highlighting is disabled by default.
self.color = None
self.bold = self.green = self.blue = ""
self.yellow = self.brown = self.reset = ""
self.bold = self.green = self.blue = self.yellow = ""
self.brown = self.magenta = self.cyan = self.reset = ""
def activate_color(self, style):
"IRC color codes."
if style == 'mIRC':
self.bold = '\x02'
self.green = '\x033'
self.blue = '\x032'
self.yellow = '\x037'
self.brown = '\x035'
self.reset = '\x0F'
if style == 'ANSI':
self.bold = '\x1b[1m'
self.green = '\x1b[1;32m'
self.blue = '\x1b[1;34m'
self.red = '\x1b[1;31m'
self.yellow = '\x1b[1;33m'
self.brown = '\x1b[33m'
self.magenta = '\x1b[35m'
self.cyan = '\x1b[36m'
self.reset = '\x1b[0m'
def load_preferences(self, conf):
"Load preferences from a file in the repository root."
......
......@@ -119,8 +119,7 @@ variable is "None", no compression will be attempted.</para>
<varlistentry>
<term>color</term>
<listitem>
<para>If "mIRC", highlight notification fields with mIRC color codes.
If "ANSI", highlight notification fields with ANSI color escape sequences.
<para>If "ANSI", highlight notification fields with ANSI color escape sequences.
Defaults to "none" (no colors). Note: if you turn this on and
notifications stop appearing on your channel, you need to turn off
IRC's color filter on that channel. To do this you will need op
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment