Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.