Skip to content

Cmder's shell in other terminals

David Refoua edited this page Aug 14, 2024 · 12 revisions

Launch from CMD.EXE (i.e. Command Prompt)

You can start Cmder's shell in other terminals.

  1. Make sure that the cmder_shell.cmd file exists in the following path: [cmder_root]\vendor\bin\cmder_shell.cmd

    If you don't see this file, update Cmder to the latest version.

  2. Create a file named cs.cmd (or anything else) to call the Cmder shell in this path:
    [cmder_root]\cs.cmd
    Tip: You can save cs.cmd in any other directory that is also present in the %PATH% environment variable.

    The content should be:

    @"%~dp0\vendor\bin\cmder_shell.cmd" %*

    Or, if you put cs.cmd in any other place beside Cmder's root directory (i.e. [cmder_root]):

    @"%cmder_root%\vendor\bin\cmder_shell.cmd" %*

    This is so when you type cs in any Command Prompt window, the Cmder's clink shell is launched.
    Alternatively, you can forgo this step, and call the cmder_shell.cmd directly from its path.

  3. Important Add Cmder's installation path to %PATH%:
    https://github.com/cmderdev/cmder/wiki/Setting-up-Environment-Variables#3-adding-to-path

  4. Type cs from Cmd.exe to get the Cmder's shell:
    (If you chose another name in step 2, enter that instead of cs)

    cmd-cmder
  5. Optional Install OneHalfDark color scheme:

    1. Install Microsoft's ColorTool.exe from here
    2. Download OneHalfDark.itermcolors
    3. Read this guide to apply the color scheme, for example:
    colortool -b OneHalfDark
  6. Optional Install the agave, or your custom monospace font, and set it as the default font for Cmd.exe

    Demo:

    cmder_shell_in_cmd exe

Now, whenever you type cs in any shell, you'll get the Cmder's clink shell.

This works also when you're in remote shells, e.g. if you ssh to your machine, you can type cs in there to get Cmder's clink shell.

 

Add to AutoRun

If you add cmder_shell.bat to the AutoRun registry key, the Cmder shell will start in CMD.EXE each time you open a new cmd window.

  1. Open RegEdit.exe and navigate to the following key (Create the Key if it doesn't exist):
    • For Current User Only: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    • For All users on the PC: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor
  2. Either Edit or Create a new key to create a String (REG_SZ) and enter the name as AutoRun, then enter the following as Data:
cmder_shell.bat
  1. Assuming that you have followed the %PATH% instructions correctly, every time you open the CMD.EXE, you'll have the Cmder shell in your terminal.

⚠ Word of caution (originally from https://github.com/cmderdev/cmder/issues/2650#issuecomment-1016459184)

Setting up AutoRun like that will slow down every CMD invocation (even the many background ones that don't show any window), and can potentially interfere with OS or app internal invocations of CMD that aren't expecting Cmder to do so much work. The script could also potentially cause things like installing OS updates to malfunction.

Something to keep it in mind in case you ever notice strange glitches in the future (or various operations being slower than normal) -- removing the script from AutoRun can be a good troubleshooting step whenever strange things are afoot on the computer.

 


 

Registry tweaks

Here's the full registry tweaks. You can save this in a 📁 Console.reg file using your text editor (e.g. Notepad), then double click it to install.

Modify it to your needs before installations.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Console]
"ForceV2"=dword:00000001 ; 1 to enable the new improved console features
"CtrlKeyShortcutsDisabled"=dword:00000000 ; 0 to enable new key shortcuts
"VirtualTerminalLevel"=dword:00000001 ; 1 to enable VT100 colors
"FilterOnPaste"=dword:00000001 ; 1 to enable new paste behavior (replace some special characters such as “smart quotes”)
"QuickEdit"=dword:00000001 ; 1 to enable selection of text via mouse for copy and paste
"InsertMode"=dword:00000001 ; 1 to enable Insert mode, 0 for Overtype mode
"LineSelection"=dword:00000001 ; 1 to enable wrapped text selection
"LineWrap"=dword:00000001 ; 1 to have the Windows Console Host break long lines into multiple rows
"CursorSize"=dword:00000019 ; cursor height as a percentage of a single character
"ExtendedEditKey"=dword:00000000 ; 1 to allow the use of extended edit keys
"ExtendedEditKeyCustom"=dword:00000000
"EnableColorSelection"=dword:00000000 ; 1 to allow selection colorization
"HistoryBufferSize"=dword:00000032 ; number of commands to store in the command history buffer
"HistoryNoDup"=dword:00000001 ; 1 to prevent duplicate entries in the history
"NumberOfHistoryBuffers"=dword:00000004 ; number of history buffers
"ScrollScale"=dword:00000001 ; number of lines to scroll when holding the shift key
"TerminalScrolling"=dword:00000000 ; 1 to enable terminal scrolling
"CurrentPage"=dword:00000000 ; current page number
"LoadConIme"=dword:00000000 ; only used for asian script input locales
"TrimLeadingZeros"=dword:00000000 ; remove zeroes from the beginning of a selected string on copy (e.g. `00000001` becomes `1`)
"WordDelimiters"="`;:,.[]{}()/\\|^&*-=+" ; characters that delimit words. by default, only the space character is used when selecting text word-by-word with CTRL+SHIFT+ARROW keys.
"ScreenBufferSize"=dword:012c0050 ; 0x012c = 300 rows, 0x0050 = 80 columns
; Terminal window options
"WindowAlpha"=dword:000000fc ; window opacity (0x4d = 30% to 0xff = 100%)
"WindowSize"=dword:00190050 ; terminal columns and rows (0x0019 = 25 rows, 0x0050 = 80 cols)
"FullScreen"=dword:00000000 ; 1 to enable full screen window
; Font preferences
"FaceName"="Consolas"
"FontFamily"=dword:00000036 ; enable TrueType font
"FontWeight"=dword:00000190 ; font weight
"FontSize"=dword:00100000 ; font size
; Color preferences
"CursorColor"=dword:ffffffff ; cursor color
"DefaultBackground"=dword:ffffffff ; default background color
"DefaultForeground"=dword:ffffffff ; default foreground color
"PopupColors"=dword:000000f5 ; popup colors (press F2 to activate)
"ScreenColors"=dword:00000007 ; screen colors
; OneHalf dark color scheme
"ColorTable00"=dword:00332c27
"ColorTable01"=dword:00efaf61
"ColorTable02"=dword:0079c398
"ColorTable03"=dword:00c1b556
"ColorTable04"=dword:00756cdf
"ColorTable05"=dword:00dd77c5
"ColorTable06"=dword:007ac0e4
"ColorTable07"=dword:00e4dfdb
"ColorTable08"=dword:0074635a
"ColorTable09"=dword:00efaf61
"ColorTable10"=dword:0079c398
"ColorTable11"=dword:00c1b556
"ColorTable12"=dword:00756cdf
"ColorTable13"=dword:00dd77c5
"ColorTable14"=dword:007ac0e4
"ColorTable15"=dword:00e4dfdb