Computing.Net > Forums > Linux > Colors in Nano?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Colors in Nano?

Reply to Message Icon

Name: MicrosoftMAN
Date: November 26, 2004 at 23:12:34 Pacific
OS: N/A
CPU/Ram: N/A
Comment:

Can I easily add ANSI/ASCII color codes into text files from nano? I wish to put color in and trying Google but I am getting no where.



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: November 27, 2004 at 00:17:30 Pacific
Reply:

Yes: When you want to change colours, hit the escape key then the 'v' key then the escape key again then follow that with your CSI colour sequence eg. [1;31m then the rest of your text.

When you type: <esc> <v> <esc>

You should see: ^[

If not, try <Left Alt> <v> <esc>


0

Response Number 2
Name: MicrosoftMAN
Date: November 27, 2004 at 01:20:13 Pacific
Reply:

Nice. It worked locally just not via SSH on the server I wished to do it on.


0

Response Number 3
Name: Wolfbone
Date: November 27, 2004 at 02:23:14 Pacific
Reply:

No - ssh is a problem. A way round it is to edit your file as normal but define your own mark-up for it eg:

...
...
Mary had a <bred>little</bred> lamb
...
...

then use awk to convert the file:

awk '{gsub(/<bred>/,"\033[1;31m"); gsub(/<\/bred>/,"\033[m"); print}' input > output


0

Response Number 4
Name: 3Dave
Date: November 30, 2004 at 06:41:58 Pacific
Reply:

FYI:

The colours folow the ISO 6429 colour codes:
0 to restore default color
1 for brighter colors
4 for underlined text
5 for flashing text
30 for black foreground
31 for red foreground
32 for green foreground
33 for yellow (or brown) foreground
34 for blue foreground
35 for purple foreground
36 for cyan foreground
37 for white (or gray) foreground
40 for black background
41 for red background
42 for green background
43 for yellow (or brown) background
44 for blue background
45 for purple background
46 for cyan background
47 for white (or gray) background


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Colors in Nano?

ansi color in MSDOS www.computing.net/answers/linux/ansi-color-in-msdos/20779.html

color in text mode www.computing.net/answers/linux/color-in-text-mode/15630.html

Colors in Linux 2.2.14-5.0 www.computing.net/answers/linux/colors-in-linux-221450/18134.html