-
Notifications
You must be signed in to change notification settings - Fork 2k
Customization
This page will explain how you can modify the look and different behaviors of Cmder to your needs.
By the way, You can ✨ contribute to this page too!
📜 Table of contents
-
Shells
-
Cmd/Clink
- Prompt customization (color, text)
- Clink auto answer (e.g. `Terminate batch job (Y/N)?`)
- Powershell
- Bash
-
Cmd/Clink
-
Window
- Icons – change icon color
-
Terminal emulators
- Hyper with Cmder
- Fluent Terminal – blur behind (i.e. "acrylic" effect)
- Color schemes
name | description |
---|---|
👉 Note: | This is an important note to follow |
👉 Tip! | This is a suggestion or a reminder |
TODO: | Describes an incomplete section |
TBA | To be added section |
- The configuration files and modification needs to be placed in the
[cmder_root]\config
directory.
Do not edit the files in the[cmder_root]\vendor
directory, as they will get overwritten on each Cmder update. - Make sure you update to the latest version of Cmder before applying customizations to your shell. The customization guide below only works with the recent versions of Cmder, older versions do not include the required files for configuration.
Cmder can run a variety of different shell profiles (e.g. bash
, cmd
and powershell
).
When you open Cmder, the default cmd shell is displayed. If you're using another shell, you need to also configure it to your liking.
The shell for cmd
is enhanced by clink
and clink-completions
that are included in your Cmder package.
We will explain how you will be able to change properties such as the prompt text, color, and auto-answer to Ctrl-C behavior.
👉 Note: Clink uses a programming language -- called Lua -- in order to store its configuration files. You can read the manual to learn the syntax, if you are interested.
The default prompt text and color are defined in the the vendor
directory here and should not be modified.
In order to make persistent changes across updates, you'll need to edit the clink profile file at the following path:
%cmder_root%\config\cmder_prompt_config.lua
For example, if you have nano
text editor installed on your machine (included in the Cmder Full version), type this to create or open the file:
λ nano %cmder_root%\config\cmder_prompt_config.lua
👉 Tip! If you don't have the nano
editor (or are not comfortable using it to edit your files), feel free to substitute it with your editor of choice (e.g. code
for VS Code or notepad
for Notepad).
The full edition of the Cmder includes nano editor as part of git
for Windows. You can of course also install nano separately, or use a different text editor (such as vim
) altogether.
👉 Tip! Hit Ctrl + F (using VS Code or Notepad) or Ctrl + W (using Nano) to find each entry.
Turn this option on to show the entire prompt in one line, as opposed to different lines for displaying the current directory and the prompt.
Example:
prompt_singleLine = true
The color is controlled by escape sequences, which is written as ESC [ <number> ; <number> ; ... m
in the documentation, or \x1b[
nnn m
in our clink.lua
file.
For example, \x1b[1;32;40m
will display a green text. Each number can be prepended using a semicolon ;
in order to add to the text style (e.g. codes 30-37 set the foreground text color, codes 40-47 set the background color, code 1 makes the text bold. So 31;47;1
produces a red text in white background in bold).
If you change 32
to 36
, you'll get a cyan path:
If you change 32
to 33
, you'll get a yellow path:
Color | Foreground | Background | Bright Foreground | Bright Background |
---|---|---|---|---|
Black | 30 | 40 | 90 | 100 |
Red | 31 | 41 | 91 | 101 |
Green | 32 | 42 | 92 | 102 |
Yellow | 33 | 43 | 93 | 103 |
Blue | 34 | 44 | 94 | 104 |
Magenta | 35 | 45 | 95 | 105 |
Cyan | 36 | 46 | 96 | 106 |
White | 37 | 47 | 97 | 107 |
Code | Effect | Description |
---|---|---|
0 | Reset / Normal | Turns off all styles and produces a normal prompt |
1 | Bold | Display text in bold or increased intensity |
2 | Dim | Terminal-dependant; shows text with lighter colors or decreased intensity |
3 | Italic | Display text in italic |
4 | Underline | Display text with underline |
7 | Reverse | Swap the colors of background and foreground |
👉 Tip! You can chain multiple colors codes using the semicolon character, e.g. 1;31;40
will produce a bold text in red on a black background.
Read this page for a complete list of colors.
For further customization, have a look at this comment.
Here's the default color codes:
uah_color = "\x1b[1;33;49m" -- Green = uah = [user]@[hostname]
cwd_color = "\x1b[1;32;49m" -- Yellow cwd = Current Working Directory
lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color
clean_color = "\x1b[1;37;49m"
dirty_color = "\x1b[33;3m"
conflict_color = "\x1b[31;1m"
unknown_color = "\x1b[37;1m" -- White = No VCS Status Branch Color
👉 Tip! The color code 40
will produce a black background, click here for more details. Use color code 49
for a transparent background color.
You can change the lambda λ
to any custom UTF-8 character by modifying the lambda
variable in your lua script.
Then replace it with the default symbol, like this:
prompt_lambSymbol = "★"
👉 Note: Make sure both your terminal emulator (e.g. ConEmu) and your font (e.g. Consolas) can support and display your character.
We recommend using Windows Terminal, Hyper, Terminus or FluentTerminal as your terminal emulator and either Fira Code, Hasklig or Source Code Pro as your font.
You can configure Cmder to automatically answer Cmd.exe
messages.
The settings file for the shell is located here:
[cmder_root]\config\clink_settings
For example, if you have nano
text editor installed on your machine, type this to create or open the file:
λ nano %cmder_root%\config\settings
👉 Tip! As always, you can use a different text editor (such as notepad
) instead of nano
.
Method 1: Add for the following subsection:
# name: Auto-answer terminate prompt
# type: enum
# options: off,answer_yes,answer_no
cmd.auto_answer = answer_yes
– OR –
Method 2: Enter the following into your Cmder shell:
clink set cmd.auto_answer answer_yes
Which outputs:
Setting 'cmd.auto_answer' set to 'answer_yes'
👉 Note: Restart Cmder session to take effect, if required.
Source: @edmundo096
See also: #108, #1666 and this stackoverflow post.
TODO: 👉 Tip! How to use ~ (tilde) for home directory
Update: Cmder has more information in this issue: Use ~ for User's Home directory
A solution to make cd ~
work in Cmder: here
TODO: TBA.
TODO: 👉 Tip! For PowerShell customization, follow this link. Also, check out cmder-powerline-prompt.
TODO: TBA.
TODO: 👉 Tip! How to add λ to the bash shell and cygwin
You can change the lambda λ
symbol for the bash shell prompt by creating/editing the ~/.config/git/git-prompt.sh
file.
If it's empty (or non-existent) firstly open the default bash prompt file from here, find the first line containing PS1=
and copy all lines from that line to the last line containing PS1=
you see (right before the fi
statement).
Then adjust the PS1="$PS1"'λ '
line to your liking, and save it.
More information: /~https://github.com/cmderdev/cmder/blob/master/vendor/git-prompt.sh
This section explains customizations related to the terminal window (e.g. icon, transparency, acrylic blur, etc)
Cmder package includes 6 rainbow-colored icons in addition to the default icon.
The icons are available in the icons
folder:
[cmder_root]\icons\cmder_*.ico
You can choose one for the Cmder shortcut.
To do so, right-click on the shortcut file, from Properties → Shortcut → Change Icon... open and select the new cmder icon.
Cmder is a terminal package that includes ConEmu as the underlying terminal emulator, and different shell profiles.
You can replace ConEmu with different terminal emulators, such as Hyper, Terminus or FluentTerminal.
Hyper is a terminal emulator built with web-technologies such as xterm.js and Electron. Read more…
Fluent Terminal is a terminal emulator built with UWP and xterm.js. It is GPU-accelerated and uses web-technologies.
Here's how the acrylic blurred-behind looks:
This effect is achieved using FluentTerminal integration.
👉 Note: The following color schemes are made for the ConEmu terminal emulator. Other terminal emulators (such as Hyper, Terminus and Fluent Terminal) use different scheme formats.
-
🐼 Panda Syntax Theme for Cmder – 💾 Download
-
More color schemes – 💾 Download
-
Dracula for cmder – 💾 Download