LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   List of '\e' escape characters, please (https://www.linuxquestions.org/questions/programming-9/list-of-%5Ce-escape-characters-please-820298/)

Kenny_Strawn 07-16-2010 07:00 PM

List of '\e' escape characters, please
 
Even with extensive reading on C and C++, I still cannot find documentation on the use of the '\e' escape character. Any ideas where you can find some of it? Google returns no relevant results.

I am trying to figure out how you would use that character to change text color (e.g. '\e[*m')

Sergei Steshenko 07-16-2010 07:41 PM

Quote:

Originally Posted by Kenny_Strawn (Post 4035861)
Even with extensive reading on C and C++, I still cannot find documentation on the use of the '\e' escape character. Any ideas where you can find some of it? Google returns no relevant results.

I am trying to figure out how you would use that character to change text color (e.g. '\e[*m')

First of all the thread name doesn't make sense. This is because '\e' is just one character (i.e. singular), but the thread name contains the word "characters", i.e. plural.

Anyway, enter into Google

"C" escape characters

and read the matches. The text you are supposed to read do provide info on how to include into a string any character.

You are probably also interested in http://en.wikipedia.org/wiki/ANSI_escape_code .

MTK358 07-18-2010 08:09 AM

The escape codes to change the color, etc, have nothing to do with C!

They are implemented in the terminal.

bigearsbilly 07-21-2010 01:02 PM

ansi/vt100 escape sequences are what you want.
google

http://ascii-table.com/ansi-escape-sequences-vt-100.php

you can play with these on an xterm,

say:
Code:

printf "\033[5m"
will make the text blink.


All times are GMT -5. The time now is 10:40 PM.