Hi, it works fine when output from the compiler, for example if you have 
a Visual Studio-flavored Qt Creator you can stuff #pragma message lines 
in your code, like this:
#pragma message("\x1b[38;5;82mHello")
#pragma message("\x1b[38;5;198mWorld")

Rgrds Henry


On 2014-12-27 16:13, Xiaofeng Wu wrote:
> Now the output is
> "Hello World"
> with code,
> std::cout << "\x1b[32mHello \x1b[34mWorld\x1b[m" << std::endl;
>
> Best,
> Xiaofeng
>
> On Sat, Dec 27, 2014 at 9:56 AM, Petar Perisin <[email protected]
> <mailto:[email protected]>> wrote:
>
>     It seems like ansiescapecodehandler.cpp defines escape as
>
>     \x1b[
>
>     so try that instead of '\e['
>
>     try simple colors for start, like
>
>     \x1b[32mHello \x1b[34mWorld\x1b[m
>
>     or something similar.
>
>
>     Regards,
>     Petar
>
>
>
>     On Sat, Dec 27, 2014 at 3:43 PM, Xiaofeng Wu <[email protected]
>     <mailto:[email protected]>> wrote:
>
>         Hi,
>
>         I tried double the backslash with code
>         std::cout << "\\e[38;5;82mHello \\e[38;5;198mWorld" << std::endl;,
>           the output is like
>         "\e[38;5;82mHello \e[38;5;198mWorld"
>         Any other suggestion for making it work correctly?
>
>         Thanks,
>         Xiaofeng
>
>         On Sat, Dec 27, 2014 at 9:14 AM, Petar Perisin
>         <[email protected] <mailto:[email protected]>> wrote:
>
>             Hi,
>
>             I haven't tried, but try to double the backslash:
>
>             std::cout << “\\e[38;5;82mHello \\e[38;5;198mWorld” <<
>             std::endl;
>
>             also, you might need to end colors somewhere.
>
>             Regards,
>             Petar
>
>             On Sat, Dec 27, 2014 at 3:34 AM, Xiaofeng Wu
>             <[email protected] <mailto:[email protected]>> wrote:
>
>                 In the change log of Qt Creator 3.3.0, it says the
>                 application output panel support ansi color.
>                 But when I try to print colored texts like
>
>                 std::cout << “\e[38;5;82mHello \e[38;5;198mWorld” <<
>                 std::endl;
>
>                 What I can see from the application output panel is the
>                 verbatim output of the string, instead of colored text
>                 of “Hello Wolrd”
>
>                 Am I using it in the wrong way?
>
>
>                 _______________________________________________
>                 Qt-creator mailing list
>                 [email protected] <mailto:[email protected]>
>                 http://lists.qt-project.org/mailman/listinfo/qt-creator
>
>
>
>
>
>
>
> _______________________________________________
> Qt-creator mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>


_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qt-creator

Reply via email to