Skip to content

Cmder's shell in other terminals

Ygor Amorim edited this page Sep 14, 2022 · 12 revisions

Launch from CMD.EXE

You can start Cmder's shell in other terminals.

  1. Create a cmder_shell.bat file with the following content:

    @echo off
    
    if "%cmder_init%" == "1" (
      "%CMDER_ROOT%\vendor\clink\clink.bat" inject -q --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
    ) else (
      set cmder_init=1
    )
    
    pushd %CMDER_ROOT%
    call "%CMDER_ROOT%\vendor\init.bat" /f
    popd
  2. Save it in your Cmder installation folder:
    [cmder_root]\cmder_shell.bat
    Tip: You can save cmder_shell.bat in any other directory that is also present in the %PATH% environment variable.

  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 cmder_shell from CMD to get the Cmder's shell:

    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

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 for 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 use 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 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 ; how many commands to store in the command history buffer
"HistoryNoDup"=dword:00000001 ; 1 to prevent duplicate entries in the history
"NumberOfHistoryBuffers"=dword:00000004
"ScrollScale"=dword:00000001 ; how many lines to scroll when holding shift key
"TerminalScrolling"=dword:00000000
"CurrentPage"=dword:00000000
"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 cols
; 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 true type font
"FontWeight"=dword:00000190
"FontSize"=dword:00100000
; Color preferences
"CursorColor"=dword:ffffffff
"DefaultBackground"=dword:ffffffff
"DefaultForeground"=dword:ffffffff
"PopupColors"=dword:000000f5 ; press F2 to activate
"ScreenColors"=dword:00000007
; OneHalf 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