Package: chromaterm
ChromaTermChromaTerm (ct) is a Python script that colors your terminal's output using
regular expressions. It even works with interactive programs, like SSH.Installationpip3installchromatermUsagePrefix your command withct. It's that simple.ctsshsomewhereYou can also pipe data intoct, but some programs behave differently when piped,
likelesswould output the entire file.echo"Jul 14 12:28:19  Message from 1.2.3.4: Completed successfully"|ctPersistenceTo always highlight a program, set up an alias in your.bash_profile. For
instance, here's one forssh.aliasssh="ct ssh"If you want to highlight your entire terminal, have ChromaTerm spawn your shell by
modifying the shell command in your terminal's settings to/usr/local/bin/ct /bin/bash --login.
Replace/bin/bashwith your shell of choice.Highlight RulesChromaTerm reads highlight rules from a YAML configuration file, formatted like so:rules:-description:Obligatory "Hello, World"regex:Hello,?\s+Worldcolor:f#ff0000-description:Spit some facts (emphasize "NOT" so they get it)regex:Pineapple does (NOT) belong on pizzacolor:0:bold1:blink italic underlineThe configuration file can be placed in one of the locations below. The first one
found is used.$HOME/.chromaterm.yml$XDG_CONFIG_HOME/chromaterm/chromaterm.yml($XDG_CONFIG_HOMEdefaults to$HOME/.config)/etc/chromaterm/chromaterm.ymlIf no file is found, a default one is created in your home directory.Check outcontrib/rules;
it has some topic-specific rules that are not included in the defaults.DescriptionOptional. It's purely for your sake.RegExThe RegEx engine used is Python'sre,
but it can be switched to PCRE2 (see relevant section below).ColorBackground and ForegroundThe color is a hex string prefixed bybfor background (e.g.b#123456) andffor foreground (e.g.f#abcdef).StyleIn addition to the background and foreground, you can also useblink,bold,invert,italic,strike, andunderline. Though, not all terminals support
those styles; you might not see their effects.GroupColors can be applied per RegEx group (see the 2nd example rule). Any group in
the RegEx can be referenced, including group0(entire match) andnamed groups.ExclusiveWhen multiple rules match the same text, ChromaTerm highlights the text with all
of the colors of the matching rules. If you want the text to be highlighted only
by the first rule that matches it, use theexclusiveflag.-regex:hellocolor:boldexclusive:trueIn the code above, no other rule will highlighthello, unless it comes first
and has theexclusiveflag set.PaletteYou can define colors in a palette and reference them by name. For instance:palette:# Created from https://coolors.co/9140f5-bd5df6-e879f6purple-1:'#9140f5'purple-2:'#bd5df6'purple-3:'#e879f6'rules:-regex:hellocolor:f.purple-1-regex:hicolor:b.purple-3When referencing a palette color, prefix it withb.for background andf.for
foreground.PCRE2If thePCRE2library is present, you can use it instead of Python'sreengine. When present, an option inct -hbecomes available.While the performance improvement is significant (~2x), the two RegEx engines
have a few differences; use this option only if you have a good understanding
of their unique features.The default rules work on both engines.HelpIf you've got any questions or suggestions, please open up anissue(always
appreciated).Windows supportTo use ChromaTerm on Windows, you will need to run it with theWindows Subsystem for Linux (WSL)