Highlighting Cisco keywords/output on Linux

As you might know, one of the most favorite tools of sysadmins and netadmins around the world, SecureCRT, does not work that well on Linux (sadly). The most powerful feature (in my opinion), keyword highlighting, does not work on the Linux version.

So, I made my own hacked-together version of SecureCRT, with blackjack and hookers.

UPDATE 2018/07/15 Saria Hajjar has rewritten ChromaTerm to be faster, better, more stable and generally maintained - meet ChromaTerm--! The guide has been updated to use his tool instead of the old ChromaTerm.

The setup

For the terminal emulator, I chose gnunn1's Tilix, which supports tabs out of the box. For the more CLI-adept, tmux or screen is a valid choice as well.

Inside Tilix, I run the ChromaTerm-- colorizer (made by Saria Hajjar).

As you might not want your normal bash output to be colorized, try using the following aliases and functions instead:

function ctssh {
  ssh $@ | ct 
}

function cttelnet {
  telnet $@ | ct 
}

Those with GNS3 can use the following console command to combine Tilix and ChromaTerm--:

tilix -t "%d" -e "bash -c 'telnet %h %p | ct'"

The config

The lion's share of the work was creating a proper configuration for ChromaTerm--. Using feral packet's SecureCRT highlight config as a reference, I also added some new keywords that I found to be handy.

The complete configuration can be either downloaded from here, or you can find an archived version of it as a Gist, in case this site ever goes down. I am open to improvements or changes, it'd be really nice to see this config flourish over the years.

To use this config, just copy the configuration file to your home directory and rename it to .chromatermrc.

The result

Why bother putting this together, you might ask? You haven't even seen what the setup looks like!

RIB:

BGP routes:

BGP flap:

IP and IPv6 addresses:

Interface statistics:

Coloring is not very useful / that great on configuration listings, feel free to send me a pull request / message in case you have improved the script on this front (or in any way!)

Legacy setup

For the terminal emulator, I chose gnunn1's Tilix, which supports tabs out of the box. For the more CLI-adept, tmux or screen is a valid choice as well.

Inside Tilix, I run the ChromaTerm shell wrapper (from the guys at TunnelsUp)

As you might not want your normal bash output to be colorized, try using the following aliases and functions instead:

function ctssh {
  SHELL="ssh $@" ct 
}

function cttelnet {
  SHELL="telnet $@" ct 
}

alias ct="ct -G"

Those with GNS3 can use the following console command to combine Tilix and ChromaTerm:

tilix -t "%d" -e "bash -c 'SHELL=\"telnet %h %p\" ct -G' "

Legacy config

The old config can be found below in case you would like to use the old ChromaTerm:

The complete configuration can be either downloaded from here, or you can find an archived version of it as a Gist, in case this site ever goes down. I am open to improvements or changes, it'd be really nice to see this config flourish over the years.

To use this config, just copy the configuration file to your home directory.

Legacy caveats

As you can see, any entered input is immediately parsed, which, for example, causes the letter(s) r to be immediately highlighted. I haven't found a good solution for this yet, this is most likely ChromaTerm's limitation.

Large amounts of output might lock up ChromaTerm, I haven't experienced this bug yet myself.