Change the color of the text in console

Hello !

Is there a way to change the color of println() output text in console in windows?

Thank you!

I don’t know if that is possible, but you can always replace println with @info if you want to make your logs more visible.

1 Like

Did you already have a look at printstyled?

4 Likes

Ok, thank you !

YES!!! that is what I want ! thank you!!!

The solution of @jbrea is much better! I didn’t know about that.

The solution of @jbrea works only in REPL. In console is not working, the output is still white text on black background.

Try run julia with the --color=yes flag.

@jbrea Now works! How can I do this to work by double clicking the program and not by writing in console “julia --color=yes program.jl” ? Thank you!

No clue, it’s a long time I did something on Windows :slightly_smiling_face: Is there a way to edit the command that is executed when you double click a file?

You typically double click a link to the .exe file. You can edit the properties of this link.

I tried to create a shortcut to program.jl and to edit the properties but doesn’t work!

  • Create a new link to the julia.exe.

  • Edit this link and add --color=yes to the line in target, which is for me C:\Users\User\AppData\Local\Programs\Julia\Julia-1.4.1\bin\julia.exe, so edit this to C:\Users\User\AppData\Local\Programs\Julia\Julia-1.4.1\bin\julia.exe --color=yes

  • Now right click on your program.jl and use “open with…”, navigate to your new link to julia.exe and check “always open …” (don’t know exact option, as I am on a german W10)

There is also the excellent

for people in touch with their inner child :wink:

2 Likes