Skip to content
David Refoua edited this page Jan 4, 2020 · 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.
BTW, 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

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

 

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.

 

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

Prompt customization

The prompt text and color are defined in the the [cmder_root]\vendor\clink.lua file.

In order to make persistent changes across updates, you'll need to create a new file at the following path:

%cmder_root%\config\my_prompt.lua

For example, if you have nano text editor installed on your machine, type this to create or open the file:

λ nano %cmder_root%\config\my_prompt.lua

👉 Note: In this example, my_prompt.lua and my_prompt_filter() refer to your desired name for file/function name, and can be replaced to any other name following the same naming convention (e.g. super_awesome_config.lua, etc.)

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

Insert (or edit) the following lines:

    local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[2;37;40m{lamb} \x1b[0m"
    local lambda = "λ"

👉 TODO: We assume that you have copied the required functions from the default [cmder_root]\vendor\clink.lua file. Otherwise, you need to edit the default file for now -- until I wrote a guide for the correct approach to register the custom file.

Same-line current working directory

In your cmder_prompt variable, remove \n that comes between {cwd} and {lamb} (Hit Ctrl + F\n to find it, then remove it.)

Example:

    local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \x1b[2;37;40m{lamb} \x1b[0m"
    local lambda = "λ"

Prompt Color

The color is controlled by escape sequences, which is written as ESC [ in the documentation or \x1b[ in our clink.lua file.

For example, \x1b[1;32;40m{cwd} will display the path ({cwd}) in green.

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.

Prompt Symbol

You can change the lambda λ to any custom UTF-8 character by modifying the lambda variable in your lua script.

You can choose a character from the following table:
(Click here to display the table)

TBA.

Then replace it with the default symbol, like this:

    local lambda = ""
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 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\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! You can use a different text editor (such as notepad) instead of nano.

Terminate batch job (Y/N)?

Method 1: Look for the following subsection:

# name: Auto-answer terminate prompt
# type: enum
#  0 = Disabled
#  1 = Answer 'Y'
#  2 = Answer 'N'
# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 =
# disabled, 1 = answer 'Y', 2 = answer 'N'.
terminate_autoanswer = 1

– OR –

Method 2: Enter the following into your Cmder shell:

clink set terminate_autoanswer 1

Which outputs:

Settings 'terminate_autoanswer' set to '1'

👉 Note: Restart Cmder session to take effect.

Source: @edmundo096
See also: #108, #1666 and this stackoverflow post.

 

Powershell

TODO: TBA.

TODO: 👉 Tip! For powershell customization, follow this link. Also, checkout 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.