Configuring Cmd Prompt
All configuration of
cmd.exe prompt (color, text, linefeeds) is done
either by the
PROMPT command (run
PROMPT /? for help)
PROMPT environment variable.
The example below shows how the default ConEmu’s Task
cmd (Admin) looks like:
If you run
set PROMPT there you’ll see following configuration string:
$ set prompt PROMPT=$E[32m$E]9;8;"USERNAME"$E\@$E]9;8;"COMPUTERNAME"$E\$S$E[92m$P$E[90m$_$E[90m$$$E[m$S
As I’ve said before all macros are described in the
PROMPT /? printout.
Also, there are some
$E... macroses which are ANSI escape codes.
$E[32m is a standard ANSI color switch.
$E]9;8;"USERNAME" is a ConEmu extension to ANSI standard which prints
the content of the
USERNAME environment variable.
How to set up your prompt automatically
There are two ways actually. First one is to define
PROMPT variable before
For example you may type the following in your Task:
set PROMPT=$P$_$G & cmd.exe
And your prompt will looks like
Another way is to use initialization script. The nice example you may see in the ConEmu files:
In breif you have to create
YourInit.cmd file with following command:
and run your
cmd.exe as follows
cmd.exe /k YourInit.cmd
PROMPT /? to learn possible macros
and look at ANSI escape codes for the more power.