Skip to content

Commit 3bf210f

Browse files
committed
print input and answer color in bold if given an ENV color
1 parent 0cb7310 commit 3bf210f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ New language features
1414
Language changes
1515
----------------
1616

17-
* The function `print_with_color` no longer prints text in bold by default. As a side effect this means that if you are using `JULIA_INPUT_COLOR` to change the input color it will no longer be bold.
17+
* The function `print_with_color` no longer prints text in bold by default.
1818

1919
Breaking changes
2020
----------------

base/client.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const disable_text_style = AnyDict(
3434

3535
# Create a docstring with an automatically generated list
3636
# of colors.
37-
const possible_formatting_symbols = [:normal, :bold, :italics, :underline]
37+
const possible_formatting_symbols = [:normal, :bold, :italics, :underline, :default]
3838
available_text_colors = collect(keys(text_colors))
3939
available_text_colors = cat(1,
4040
sort(intersect(available_text_colors, possible_formatting_symbols), rev=true),
@@ -49,7 +49,7 @@ const available_text_colors_docstring =
4949
Available colors are: $available_text_colors_docstring.
5050
5151
The color `:default` will print text in the default color while the color `:normal`
52-
will print text with all properties reset to normal (including boldness, italics etc).
52+
will print text with all properties reset to normal (including boldness, italics etc.).
5353
"""
5454
text_colors
5555

@@ -72,8 +72,8 @@ end
7272

7373
warn_color() = repl_color("JULIA_WARN_COLOR", default_color_warn)
7474
info_color() = repl_color("JULIA_INFO_COLOR", default_color_info)
75-
input_color() = text_colors[repl_color("JULIA_INPUT_COLOR", default_color_input)]
76-
answer_color() = text_colors[repl_color("JULIA_ANSWER_COLOR", default_color_answer)]
75+
input_color() = text_colors[:bold] * text_colors[repl_color("JULIA_INPUT_COLOR", default_color_input)]
76+
answer_color() = text_colors[:bold] * text_colors[repl_color("JULIA_ANSWER_COLOR", default_color_answer)]
7777

7878
function repl_cmd(cmd, out)
7979
shell = shell_split(get(ENV,"JULIA_SHELL",get(ENV,"SHELL","/bin/sh")))

doc/stdlib/io-network.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ Text I/O
508508
509509
Print strings in a color specified as a symbol.
510510

511-
``color`` may take any of the values ``:underline``\ , ``:normal``\ , ``:italics``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:dark_gray``\ , ``:default``\ , ``:green``\ , ``:light_blue``\ , ``:light_cyan``\ , ``:light_green``\ , ``:light_magenta``\ , ``:light_red``\ , ``:light_yellow``\ , ``:magenta``\ , ``:red``\ , ``:white``\ , or ``:yellow``\ .
511+
``color`` may take any of the values ``:underline``\ , ``:normal``\ , ``:italics``\ , ``:default``\ , ``:bold``\ , ``:black``\ , ``:blue``\ , ``:cyan``\ , ``:dark_gray``\ , ``:green``\ , ``:light_blue``\ , ``:light_cyan``\ , ``:light_green``\ , ``:light_magenta``\ , ``:light_red``\ , ``:light_yellow``\ , ``:magenta``\ , ``:red``\ , ``:white``\ , or ``:yellow``\ .
512512

513513
.. function:: info(msg...; prefix="INFO: ")
514514

0 commit comments

Comments
 (0)