3

I am trying to add color the the jquery terminal like a bash terminal in linux.

I have tried the same arrangement of color codes

\033]01;31\] # pink
\033]00m\]   # white
\033]01;36\] # bold green
\033]02;36\] # green
\033]01;34\] # blue
\033]01;33\] # bold yellow

and there is no color options.

  • The escape code should be `\033[01;31m` open bracket instead of closing and in new version of jQuery Terminal you also need unix_formatting.js file. – jcubic Dec 17 '15 at 08:51

1 Answers1

5

A function I use is like so for javascript

function teal(message) {
    return "[[gb;teal;black]" + message + "]";
}

Just wrap the string like the above.

The first colour is the text color and the second color is the background.

The gb at the start are for string formatting;

g = glow & b = bold

You can also under line and make them italic aswell

i = italic & u = underline

In the string, make sure not to have any [ or ] as this will affect the formatting. Use the escape character \[ or \] and it should work.

It will also work in C# as I have done this myself and should see no reason it wouldn't work with the likes of Java strings either.

jcubic
  • 61,973
  • 54
  • 229
  • 402
Tomaltach
  • 913
  • 1
  • 11
  • 30