You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fd9d206
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/quickstart.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,7 @@ Some standalone examples of Click applications are packaged with Click. They are
24
24
performs custom validation of parameters in different ways.
25
25
-[naval](https://github.com/pallets/click/tree/main/examples/naval) : Port of the [docopt](http://docopt.org/) naval
26
26
example.
27
-
-[colors](https://github.com/pallets/click/tree/main/examples/colors) : A simple example that colorizes text. Uses
28
-
colorama on Windows.
27
+
-[colors](https://github.com/pallets/click/tree/main/examples/colors) : A simple example that colorizes text.
29
28
-[aliases](https://github.com/pallets/click/tree/main/examples/aliases) : An advanced example that implements
30
29
{ref}`aliases`.
31
30
-[imagepipe](https://github.com/pallets/click/tree/main/examples/imagepipe) : A complex example that implements some
@@ -81,7 +80,7 @@ What this means is that the {func}`echo` function applies some error correction
81
80
instead of dying with a {exc}`UnicodeError`.
82
81
83
82
The echo function also supports color and other styles in output. It will automatically remove styles if the output
84
-
stream is a file. On Windows, colorama is automatically installed and used. See {ref}`ansi-colors`.
83
+
stream is a file. See {ref}`ansi-colors`.
85
84
86
85
If you don't need this, you can also use the `print()` construct / function.
The {func}`echo` function supports ANSI colors and styles. On Windows this uses [colorama](https://pypi.org/project/colorama/).
55
+
The {func}`echo` function supports ANSI colors and styles.
56
56
57
57
Primarily this means that:
58
58
59
59
- Click's {func}`echo` function will automatically strip ANSI color codes if the stream is not connected to a terminal.
60
60
- the {func}`echo` function will transparently connect to the terminal on Windows and translate ANSI codes to terminal
61
61
API calls. This means that colors will work on Windows the same way they do on other operating systems.
62
62
63
-
On Windows, Click uses colorama without calling `colorama.init()`. You can still call that in your code, but it's not
64
-
required for Click.
63
+
:::{admonition} Older Windows Support
64
+
:class: note
65
+
66
+
Recent Windows 11 supports ANSI styling by default, in both Terminal and cmd.exe.
67
+
If you need to support color output on older versions of Windows, install
68
+
[colorama](https://pypi.org/project/colorama/) and call `colorama.init()`.
69
+
:::
65
70
66
71
For styling a string, the {func}`style` function can be used:
0 commit comments