Defining CMD prompt.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 27 Nov 2022 18:47:51 +0200
changeset 2540 d699ee7377a4
parent 2539 742921adf64c
child 2541 c41a01871780
Defining CMD prompt.
cmd.rst
--- a/cmd.rst	Sun Nov 27 18:41:07 2022 +0200
+++ b/cmd.rst	Sun Nov 27 18:47:51 2022 +0200
@@ -6,6 +6,32 @@
 .. contents::
    :local:
 
+Defining prompt
+===============
+
+Set the environmet variable ``PROMPT``, example of ``.reg`` file::
+
+  [HKEY_CURRENT_USER\Environment]
+  "PROMPT"="cmd# "
+
+I embedded current time and directory; also a new line for readability of commands when a current
+working directory path is too long::
+
+  [HKEY_CURRENT_USER\Environment]
+  "PROMPT"="$T$S$P$_cmd#$S"
+
+CMD has built-in command to modify this env var::
+
+  prompt "FORMAT"
+
+To list available options use ``prompt /?``.
+
+Resize a conhost window
+=======================
+::
+
+  cmd# mode CON: COLS=120 LINES=40
+
 Quoting.
 ========
 
@@ -79,12 +105,6 @@
 
   $ for /f "tokens=1 delims=" %%s in (users.txt) do (echo %%S & command "%%S") >> outputfile.txt
 
-Resize cmd window.
-==================
-::
-
-  cmd# mode CON: COLS=120 LINES=40
-
 Limits.
 =======