Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a terminal emulator (like GNOME terminal) for linux/unix out there, which allows for highlighting a single word always (such as "highlight the word FAIL in red")? Or maybe is there a plugin for the GNOME terminal (if such a thing like "plugins for the gnome-terminal" exists).

The solution should highlight the word regardless of what application is being run inside the terminal, i.e. running cat test.txt should highlight the word as well as make all.

Any help is greatly appreciated by my bleary-eyed eyes.

share|improve this question
KDE Konsole will highlight any word that is in its search bar - you can run this under Gnome. Would that work? – Paul Jan 16 '12 at 23:54
@Paul thanks, that's a start :-) – scravy Jan 22 '12 at 12:11
up vote 3 down vote accepted

Using bash, you can highlight all the word 'FAIL' in red using the following commands:

txtred=$(echo -e '\e[0;31m')
txtrst=$(echo -e '\e[0m')
bash | sed -e "s/FAIL/${txtred}FAIL${txtrst}/g"

What it does is creating a new bash shell and editing stdout of this new shell using sed. If you want to end the stdout edition, simply type exit to return back to your previous shell. You can find more color commands here. The echo -e variation is needed to get the real ESCAPE value of \e.

I tried it with echo and cat in this subshell and it is working. However, it breaks programs expecting a terminal as their output like vi. I guess that it would also break programs using special output buffering. It is also breaking commands like echo -n FAIL and change the behavior of commands like ls (ls prints many files per line when the output is a terminal, and one file per line when the output is a pipe).

share|improve this answer

clide works fine. I use it on RHEL 6.2, from the EPEL repository

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .