LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2010, 07:00 PM   #1
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
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')
 
Old 07-16-2010, 07:41 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Kenny_Strawn View Post
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 .

Last edited by Sergei Steshenko; 07-16-2010 at 08:41 PM.
 
Old 07-18-2010, 08:09 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
The escape codes to change the color, etc, have nothing to do with C!

They are implemented in the terminal.
 
Old 07-21-2010, 01:02 PM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
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.

Last edited by bigearsbilly; 07-21-2010 at 01:06 PM.
 
  


Reply

Tags
c++



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Having trouble with escape characters in C madsovenielsen Programming 5 03-03-2010 06:36 AM
Paths and escape characters code-breaker Linux - Newbie 4 07-11-2006 11:24 PM
Variables and escape characters? flobadon Programming 4 09-10-2005 04:34 PM
Escape Characters in linux shunraj Linux - Software 1 05-18-2004 03:21 PM
escape characters not escaping BobNz Linux - Software 2 04-09-2004 03:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration