This forum has been archived. All content is frozen. Please use KDE Discuss instead.

color output in konsole

Tags: konsole konsole konsole
(comma "," separated)
dreamz
Registered Member
Posts
70
Karma
0
OS

color output in konsole

Thu Jan 19, 2012 9:32 pm
is it possible to color output in konsole? i'd like certain phrases, e.g., warnings, to be colored to make them more conspicuous.

thanks.
airdrik
Registered Member
Posts
1854
Karma
5
OS

Re: color output in konsole  Topic is solved

Thu Jan 19, 2012 10:08 pm
If you have power over the output generated (e.g. you can modify the script/application generating the output) then you can embed escape codes in their output which will tell konsole (or any other terminal emulator) to color the output in a certain colors. See http://en.wikipedia.org/wiki/ANSI_escape_code for details.

If you don't have direct power over the output, you can create a script which intercepts the output and inserts the appropriate color escape codes.

Konsole per-se can't be configured to color text which matches certain patterns (except through the use of escape codes)


airdrik, proud to be a member of KDE forums since 2008-Dec.
dreamz
Registered Member
Posts
70
Karma
0
OS

Re: color output in konsole

Fri Jan 20, 2012 12:34 pm
thanks. i'm trying to color the output of the package manager (pacman). i'll look into escape sequences.
User avatar
einar
Administrator
Posts
3402
Karma
7
OS

Re: color output in konsole

Fri Jan 20, 2012 1:01 pm
Kind of OT, but since you mentioned pacman... Use pacman-color, which will work on all terminals.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell