From d0ac0d0cce85ac4898469a10b216150a21ce8078 Mon Sep 17 00:00:00 2001 From: Fengyang Wang Date: Wed, 25 Jan 2017 20:51:28 -0500 Subject: [PATCH] Elaborate on how to restore bold to REPL --- doc/src/manual/interacting-with-julia.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/doc/src/manual/interacting-with-julia.md b/doc/src/manual/interacting-with-julia.md index 1a7a44c81239e..a012a7da2a728 100644 --- a/doc/src/manual/interacting-with-julia.md +++ b/doc/src/manual/interacting-with-julia.md @@ -301,8 +301,9 @@ fields if the function is type stable. ## Customizing Colors -The colors used by Julia and the REPL can be customized, as well. To change the color of the Julia -prompt you can add something like the following to your `juliarc.jl` file: +The colors used by Julia and the REPL can be customized, as well. To change the +color of the Julia prompt you can add something like the following to your +`.juliarc.jl` file, which is to be placed inside your home directory: ```julia function customize_colors(repl) @@ -321,9 +322,22 @@ input and answer text by setting the appropriate field of `repl` in the `customi above (respectively, `help_color`, `shell_color`, `input_color`, and `answer_color`). For the latter two, be sure that the `envcolors` field is also set to false. +It is also possible to apply boldface formatting by using +`Base.text_colors[:bold]` as a color. For instance, to print answers in +boldface font, one can use the following as a `.juliarc.jl`: + +```julia +function customize_colors(repl) + repl.envcolors = false + repl.answer_color = Base.text_colors[:bold] +end + +atreplinit(customize_colors) +``` + You can also customize the color used to render warning and informational messages by setting the appropriate environment variables. For instance, to render error, warning, and informational -messages respectively in magenta, yellow, and cyan you can add the following to your `juliarc.jl` file: +messages respectively in magenta, yellow, and cyan you can add the following to your `.juliarc.jl` file: ```julia ENV["JULIA_ERROR_COLOR"] = :magenta