From 229f19a6e90a58b9f0e2d3468e47b88b8ec5f968 Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 21 Jun 2023 21:12:12 +0800 Subject: [PATCH] docs: slight update to writing your own prompt doc --- doc_src/prompt.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc_src/prompt.rst b/doc_src/prompt.rst index 76757dfa9..be71dc87a 100644 --- a/doc_src/prompt.rst +++ b/doc_src/prompt.rst @@ -72,11 +72,13 @@ So, taking our previous prompt and adding some color:: A "normal" color tells the terminal to go back to its normal formatting options. -What ``set_color`` does internally is to print an escape sequence that tells the terminal to change color. So if you see something like:: +``set_color`` works by producing an escape sequence, which is a special piece of text that terminals +interpret as instructions - for example, to change color. So ``set_color red`` produces the same +effect as:: echo \e\[31mfoo -that could just be ``set_color red``. +Although you can write your own escape sequences by hand, it's much easier to use ``set_color``. Shortening the working directory --------------------------------