Skip to content
David Refoua edited this page Sep 9, 2022 · 38 revisions

 



Cmder Customization Guide
A curated list by the community

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

Legend

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

 

Attention

  • 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.

 

Shells

Cmder can run a variety of different shell profiles (e.g. bash, cmd and powershell).

TODO: 👉 Tip! How to use ~ (tilde) for home directory

When you open Cmder, the default cmd shell is displayed.

Update: Cmder has more information in this issue: Use ~ for User's Home directory

A solution to make cd ~ work in Cmder: here

 

Cmd/Clink

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 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.

Prompt customization

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 notepad) altogether.

👉 Tip! Hit Ctrl + F (using VS Code or Notepad) or Ctrl + W (using Nano) to find each entry.

Same-line current working directory

Example:

prompt_singleLine = true

Prompt Color

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 cyan path:

cmder-cyan

If you change 32 to 33, you'll get yellow path:

cmder-yellow

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.

Prompt Symbol

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 = ""
cmder_shell_symbol

👉 Note: Make sure both your terminal emulator (e.g. ConEmu) and your font (e.g. Consolas) can support and display your character.

I recommend using Windows Terminal, Hyper, Terminus or FluentTerminal as your terminal emulator and either Fira Code, Hasklig or Source Code Pro as your font.

Clink auto answer

You can configure Cmder to automatically answer Cmd.exe messages.

The settings file for the shell is located in 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.

Terminate batch job (Y/N)?

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.

 

Powershell

TODO: TBA.

TODO: 👉 Tip! For PowerShell customization, follow this link. Also, check out cmder-powerline-prompt.

Bash

TODO: TBA.

TODO: 👉 Tip! How to add λ to the bash shell and cygwin

Window

This section explains customizations related to the terminal window (e.g. icon, transparency, acrylic blur, etc)

Icons

Cmder package includes 6 rainbow-colored icons in addition to the default icon.

cmder_colors

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 PropertiesShortcutChange Icon... open and select the new cmder icon.

Terminal emulators

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 Cmder

Hyper is a terminal emulator built with web-technologies such as xterm.js and Electron. Read more…

Cmder on Hyper

Fluent Terminal

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.

Cmder on FluentTerminal UWP, a transparent terminal for Windows with acrylic effect

Color schemes

👉 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.