1
vote
1answer
36 views

What's the deal with terminal colors?

There are 256 terminal color escapes available: 8 "system" colors (0 - 7) 8 "bright" system colors (8 - 15) 216, or 6*6*6 "RGB" colors (16 - 231) 24 "grayscale" colors (232 - 255) The "RGB" colors ...
2
votes
0answers
297 views

Process ANSI escape codes before piping

I'm trying to pipe the output of a script (Mocha) to another script. However there is one problem: Mocha generates quite a few ansi escape characters to update the screen on the fly. These characters ...
10
votes
2answers
1k views

Escape non-printing characters in a function for a Bash prompt

In a Bash Prompt (PS1 variable), I'm calling a function to potentially add text to the prompt: export PS1="\u@\h \$(my_function) \$ " However, the function in the prompt contains ANSI color codes ...
1
vote
1answer
555 views

ANSI prompts messed in Ubuntu 10.04 terminal window (Unicode 0002), but ok in Putty

My bash prompt is: PS1='\e[1;31m\]\[\u\e[0m\]@\h [\e[1;33m\]\w\[\e[0m\]]\$ ' (reddish username, yellowish current directory). If I connect with Putty from a Windows machine, everything is fine. If ...
2
votes
1answer
1k views

Bash color prompt and long commands

I'm colorizing parts of my bash prompt using ANSI escape sequences. This works great, until the command I'm currently typing in is long enough that it has to wrap. Instead of the rest of the command ...