cmder README

The project's README from github.com/cmderdev/cmder. As one markdown file: README.md.

Cmder

Join the chat at https://gitter.im/cmderdev/cmder Build Status

Cmder is a software package created out of pure frustration over absence of usable console emulator on Windows. It is based on ConEmu with major config overhaul, comes with a Monokai color scheme, amazing clink (further enhanced by clink-completions) and a custom prompt layout.

Cmder Screenshot

Why use it

The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, which makes it great for USB Sticks or cloud storage. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere.

The Cmder's user interface is also designed to be more eye pleasing, and you can compare the main differences between Cmder and ConEmu here.

Installation

Single User Portable Config

  1. Download the latest release
  2. Extract the archive. Note: This path should not be C:\Program Files or anywhere else that would require Administrator access for modifying configuration files
  3. (optional) Place your own executable files into the %cmder_root%\bin folder to be injected into your PATH.
  4. Run Cmder.exe

Shared Cmder install with Non-Portable Individual User Config

  1. Download the latest release
  2. Extract the archive to a shared location.
  3. (optional) Place your own executable files and custom app folders into the %cmder_root%\bin. See: bin/README.md
    • This folder to be injected into your PATH by default.
    • See /max_depth [1-5] in 'Command Line Arguments for init.bat' table to add subdirectories recursively.
  4. (optional) Place your own custom app folders into the %cmder_root%\opt. See: opt/README.md
    • This folder will NOT be injected into your PATH so you have total control of what gets added.
  5. Run Cmder.exe with /C command line argument. Example: cmder.exe /C %userprofile%\cmder_config
    • This will create the following directory structure if it is missing.

      c:\users\[username]\cmder_config
      ├───bin
      ├───config
      │   └───profile.d
      └───opt
      

Cmder.exe Command Line Arguments

Argument Description
/C [user_root_path] Individual user Cmder root folder. Example: %userprofile%\cmder_config
/M Use conemu-%computername%.xml for ConEmu settings storage instead of user_conemu.xml
/REGISTER [ALL, USER] Register a Windows Shell Menu shortcut.
/UNREGISTER [ALL, USER] Un-register a Windows Shell Menu shortcut.
/SINGLE Start Cmder in single mode.
/START [start_path] Folder path to start in.
/TASK [task_name] Task to start after launch.
/X [ConEmu extras pars] Forwards parameters to ConEmu

Context Menu Integration

So you've experimented with Cmder a little and want to give it a shot in a more permanent home;

Shortcut to open Cmder in a chosen folder

  1. Open a terminal as an Administrator
  2. Navigate to the directory you have placed Cmder
  3. Execute .\cmder.exe /REGISTER ALL If you get an "Access Denied" message, make sure you are executing the command in an Administrator prompt.

In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.

Keyboard shortcuts

Tab manipulation

Shell

(Some shortcuts are not yet documented, though they exist - please document them here)

Features

Access to multiple shells in one window using tabs

You can open multiple tabs each containing one of the following shells:

Task Shell Description
Cmder cmd.exe Windows cmd.exe shell enhanced with Git, Git aware prompt, Clink (GNU Readline), and Aliases.
Cmder as Admin cmd.exe Administrative Windows cmd.exe Cmder shell.
PowerShell powershell.exe Windows PowerShell enhanced with Git and Git aware prompt .
PowerShell as Admin powershell.exe Administrative Windows powershell.exe Cmder shell.
Bash bash.exe Unix/Linux like bash shell running on Windows.
Bash as Admin bash.exe Administrative Unix/Linux like bash shell running on Windows.
Mintty bash.exe Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences
Mintty as Admin bash.exe Administrative Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences

Cmder, PowerShell, and Bash tabs all run on top of the Windows Console API and work as you might expect in Cmder with access to use ConEmu's color schemes, key bindings and other settings defined in the ConEmu Settings dialog.

⚠ Note: Only the full edition of Cmder comes with a pre-installed bash, using a vendored git-for-windows installation. The pre-configured Bash tabs may not work on Cmder mini edition without additional configuration.

You may however, choose to use an external installation of bash, such as Microsoft's Subsystem for Linux (called WSL) or the Cygwin project which provides POSIX support on windows.

⚠ Note: Mintty tabs use a program called 'mintty' as the terminal emulator that is not based on the Windows Console API, rather it's rendered graphically by ConEmu. Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. As such, some differences in functionality are to be expected, such as Cmder not being able to apply a system-wide configuration to it.

As a result mintty specific config is done via the [%USERPROFILE%|$HOME]/.minttyrc file. You may read more about Mintty and its config file here.

An example of setting Cmder portable terminal colors for mintty:

From a bash/mintty shell:

cd $CMDER_ROOT/vendor
git clone https://github.com/karlin/mintty-colors-solarized.git
cd mintty-colors-solarized/
echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user_profile.sh

You may find some Monokai color schemes for mintty to match Cmder here.

Changing Cmder Default cmd.exe Prompt Config File

The default Cmder shell cmd::Cmder prompt is customized using Clink and is configured by editing a config file that exists in one of two locations:

If your Cmder setup does not have this file create it from %CMDER_ROOT%\vendor\cmder_prompt_config.lua.default

Customizations include:

Documentation is in the file for each setting.

Changing Cmder Default cmd.exe Shell Startup Behaviour Using Task Arguments

  1. Press Win + Alt + T
  2. Click either:
  1. Add command line arguments where specified below:

Note: Pay attention to the quotes!

cmd /s /k ""%ConEmuDir%\..\init.bat" [ADD ARGS HERE]"
Command Line Arguments for init.bat
Argument Description Default
/c [user cmder root] Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. not set
/d Enables debug output. not set
/f Enables Cmder Fast Init Mode. This disables some features, see pull request #1492 for more details. not set
/t Enables Cmder Timed Init Mode. This displays the time taken run init scripts not set
/git_install_root [file path] User specified Git installation root path. %CMDER_ROOT%\vendor\Git-for-Windows
/home [home folder] User specified folder path to set %HOME% environment variable. %userprofile%
/max_depth [1-5] Define max recurse depth when adding to the path for %cmder_root%\bin and %cmder_user_bin% 1
/nix_tools [0-2] Define how *nix tools are added to the path. Prefer Windows Tools: 1, Prefer *nix Tools: 2, No /usr/bin in %PATH%: 0 1
/svn_ssh [path to ssh.exe] Define %SVN_SSH% so we can use git svn with ssh svn repositories. %GIT_INSTALL_ROOT%\bin\ssh.exe
/user_aliases [file path] File path pointing to user aliases. %CMDER_ROOT%\config\user_aliases.cmd
/v Enables verbose output. not set
(custom arguments) User defined arguments processed by cexec. Type cexec /? for more usage. not set

Cmder Shell User Config

Single user portable configuration is possible using the Cmder specific shell config files. Edit the below files to add your own configuration:

Shell Cmder Portable User Config
Cmder %CMDER_ROOT%\config\user_profile.cmd
PowerShell $ENV:CMDER_ROOT\config\user_profile.ps1
Bash/Mintty $CMDER_ROOT/config/user_profile.sh

Note: Bash and Mintty sessions will also source the $HOME/.bashrc file if it exists after it sources $CMDER_ROOT/config/user_profile.sh.

You can write *.cmd|*.bat, *.ps1, and *.sh scripts and just drop them in the %CMDER_ROOT%\config\profile.d folder to add startup config to Cmder.

Shell Cmder Profile.d Scripts
Cmder %CMDER_ROOT%\config\profile.d\*.bat and *.cmd
PowerShell $ENV:CMDER_ROOT\config\profile.d\*.ps1
Bash/Mintty $CMDER_ROOT/config/profile.d/*.sh

Git Status Opt-Out

To disable Cmder prompt git status globally add the following to ~/.gitconfig or locally for a single repo [repo]/.git/config and start a new session.

Note: This configuration is not portable

[cmder]
  status = false      # Opt out of Git status for 'ALL' Cmder supported shells.
  cmdstatus = false   # Opt out of Git status for 'Cmd.exe' shells.
  psstatus = false    # Opt out of Git status for 'Powershell.exe and 'Pwsh.exe' shells.
  shstatus = false    # Opt out of Git status for 'bash.exe' shells.

Aliases

Cmder(Cmd.exe) Aliases

You can define simple aliases for cmd.exe sessions with a command like alias name=command. Cmd.exe aliases support optional parameters through the $1-9 or the $* special characters so the alias vi=vim.exe $* typed as vi [filename] will open [filename] in vim.exe.

Cmd.exe aliases can also be more complex. See: DOSKEY.EXE documentation for additional details on complex aliases/macros for cmd.exe

Aliases defined using the alias.bat command will automatically be saved in the %CMDER_ROOT%\config\user_aliases.cmd file

To make an alias and/or any other profile settings permanent add it to one of the following:

Note: These are loaded in this order by $CMDER_ROOT/vendor/init.bat. Anything stored in %CMDER_ROOT% will be a portable setting and will follow Cmder to another machine.

Bash.exe|Mintty.exe Aliases

Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing alias name=command will create an alias only for the current running session.

To make an alias and/or any other profile settings permanent add it to one of the following:

Note: These are loaded in this order by $CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh. Anything stored in $CMDER_ROOT will be a portable setting and will follow Cmder to another machine.

If you add bash aliases to $CMDER_ROOT/config/user_profile.sh they will be portable and follow your Cmder folder if you copy it to another machine. $HOME/.bashrc defined aliases are not portable.

PowerShell.exe Aliases

PowerShell has native simple alias support, for example [new-alias | set-alias] alias command, so complex aliases with optional parameters are not supported in PowerShell sessions. Type get-help [new-alias|set-alias] -full for help on PowerShell aliases.

To make an alias and/or any other profile settings permanent add it to one of the following:

Note: These are loaded in this order by $ENV:CMDER_ROOT\vendor\user_profile.ps1. Anything stored in $ENV:CMDER_ROOT will be a portable setting and will follow Cmder to another machine.

SSH Agent

To start the vendored SSH agent simply call start-ssh-agent, which is in the vendor/git-for-windows/cmd folder.

If you want to run SSH agent on startup, include the line @call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" in %CMDER_ROOT%/config/user_profile.cmd (usually just uncomment it).

Vendored Git

Cmder is by default shipped with a vendored Git installation. On each instance of launching Cmder, an attempt is made to locate any other user provided Git binaries. Upon finding a git.exe binary, Cmder further compares its version against the vendored one by executing it. The vendored git.exe binary is only used when it is more recent than the user-installed one.

You may use your favorite version of Git by including its path in the %PATH% environment variable. Moreover, the Mini edition of Cmder (found on the downloads page) excludes any vendored Git binaries.

Using external Cygwin/Babun, MSys2, WSL, or Git for Windows SDK with Cmder.

You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions:

  1. Setup a new task by pressing Win +Alt + T.
  2. Click the + button to add a task.
  3. Name the new task in the top text box.
  4. Provide task parameters, this is optional.
  5. Add cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console to the Commands text box.

Recommended Optional Steps:

Copy the vendor/cmder_exinit file to the Cygwin/Babun, MSys2, or Git for Windows SDK environments /etc/profile.d/ folder to use portable settings in the $CMDER_ROOT/config folder.

Note: MinGW could work if the init scripts include profile.d but this has not been tested.

The destination file extension depends on the shell you use in that environment. For example:

Uncomment and edit the line below in the script to use Cmder config even when launched from outside Cmder.

# CMDER_ROOT=${USERPROFILE}/cmder  # This is not required if launched from Cmder.

Customizing user sessions using init.bat custom arguments.

You can pass custom arguments to init.bat and use cexec.cmd in your user_profile.cmd to evaluate these arguments then execute commands based on a particular flag being detected or not.

init.bat creates two shortcuts for using cexec.cmd in your profile scripts.

%ccall% - Evaluates flags, runs commands if found, and returns to the calling script and continues.

ccall=call C:\Users\user\cmderdev\vendor\bin\cexec.cmd

Example: %ccall% /startnotepad start notepad.exe

%cexec% - Evaluates flags, runs commands if found, and does not return to the calling script.

cexec=C:\Users\user\cmderdev\vendor\bin\cexec.cmd

Example: %cexec% /startnotepad start notepad.exe

It is useful when you have multiple tasks to execute cmder and need it to initialize the session differently depending on the task chosen.

To conditionally start notepad.exe when you start a specific cmder task:

To see detailed usage of cexec, type cexec /? in Cmder.

Integrating Cmder with Windows Terminal, VS Code, and your favorite IDEs

Cmder by default comes with a vendored ConEmu installation as the underlying terminal emulator, as stated here.

However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator.

⚠ Note: Cmder includes built-in support for Windows Terminal directory tracking via OSC 9;9 sequences. This enables "Duplicate Tab" and "Split Pane" features to preserve the current working directory for both cmd.exe and PowerShell sessions.

⚠ Note: Cmder also includes built-in support for Windows Terminal shell integration via OSC 133 sequences (A, B, C, D) for PowerShell sessions. This enables features like command navigation (jump between commands), command selection, visual command separators, command exit code tracking, and improved command history management in Windows Terminal.

For instructions on how to integrate Cmder with your IDE, please read our Wiki section.

Upgrading

The process of upgrading Cmder depends on the version/build you are currently running.

If you have a [cmder_root]/config/user[-|_]conemu.xml, you are running a newer version of Cmder, follow the below process:

  1. Exit all Cmder sessions and relaunch [cmder_root]/cmder.exe, this backs up your existing [cmder_root]/vendor/conemu-maximus5/conemu.xml to [cmder_root]/config/user[-|_]conemu.xml.

    • The [cmder_root]/config/user[-|_]conemu.xml contains any custom settings you have made using the 'Setup Tasks' settings dialog.
  2. Exit all Cmder sessions and backup any files you have manually edited under [cmder_root]/vendor.

    • Editing files under [cmder_root]/vendor is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in [cmder_root]/config folder.
  3. Delete the [cmder_root]/vendor folder.

  4. Extract the new cmder.zip or cmder_mini.zip into [cmder_root]/ overwriting all files when prompted.

If you do not have a [cmder_root]/config/user[-|_]conemu.xml, you are running an older version of cmder, follow the below process:

  1. Exit all Cmder sessions and backup [cmder_root]/vendor/conemu-maximus5/conemu.xml to [cmder_root]/config/user[-|_]conemu.xml.

  2. Backup any files you have manually edited under [cmder_root]/vendor.

    • Editing files under [cmder_root]/vendor is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in [cmder_root]/config folder.
  3. Delete the [cmder_root]/vendor folder.

  4. Extract the new cmder.zip or cmder_mini.zip into [cmder_root]/ overwriting all files when prompted.

Latest Builds

You can download the latest successful builds of the current master and development branches from the GitHub Actions > Artifacts section following the links below:

Branch Build Status Download Artifacts
🔒 master master build status 📦 Artifacts
🔧 development development build status 📦 Artifacts

License

All software included is bundled with own license

The MIT License (MIT)

Copyright (c) 2016 Samuel Vasko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cmder (cmderdev/cmder)

Searching Database…

27K ·GitHub
这是什么?Cmder 是一个 Windows 控制台模拟器套装,纯粹是因为 Windows 上缺少一个能用的控制台而产生的项目。它在 ConEmu 的基础上做了大规模配置改造,配上 Monokai 配色方案、clink 和自定义提示符样式。
它是一个像 PowerShell 那样的 shell,还是一个能运行 shell 的终端窗口?它是一个终端窗口,不是 shell——底层是 ConEmu,外观已经预先配置好。你可以在它的标签页里运行 cmd、PowerShell 或 bash;Cmder 会给它们加上支持 Git 的提示符、Clink 和别名等功能。
我要怎么安装它?下载最新版本,把压缩包解压到 Program Files 或其他受管理员权限保护的文件夹之外的任意位置,然后运行 Cmder.exe。不需要安装程序,也不需要管理员权限。
我需要先装 Git、bash 或其他东西吗?不需要。它的设计是完全自成一体的——完整版甚至内置了 git-for-windows,所以 git、bash、wget 和 curl 开箱即用。
完整版和迷你版有什么区别?只有完整版自带预装好的 bash(内置的 git-for-windows)。在迷你版里,bash 和 Mintty 标签页需要额外配置——或者使用 WSL、Cygwin 之类的外部 bash。
它只能在 Windows 上运行吗,还是 Mac 和 Linux 上也能用?仅限 Windows。它基于 Windows 终端模拟器 ConEmu 构建,发布形式是 Cmder.exe——README 里没有提到任何 macOS 或 Linux 版本。
我可以把它放在 U 盘里运行吗?可以——这正是它最大的优点。它完全自成一体,你的控制台、别名以及 wget、curl、git 这类程序都在同一个文件夹里,可以整个拷到 U 盘或云存储里随身携带,便携化设置也会跟着带到另一台电脑上。
我可以在里面打开哪些 shell?标签页里可以选择 Cmder 增强版 cmd.exe(支持 Git 的提示符、Clink readline、别名)、PowerShell、Bash 和 Mintty——每一种还有'以管理员身份'的变体。Mintty 比较特殊:它不理会 ConEmu 的配色方案和按键绑定。
我能添加右键的'Cmder Here'菜单项吗?可以——在管理员命令提示符里运行 .\cmder.exe /REGISTER ALL,之后任意文件夹的右键菜单里都会出现'Cmder Here';用 /UNREGISTER ALL 可以把它移除。
我可以自定义提示符吗?可以——把 vendor 文件夹里的 cmderpromptconfig.lua.default 复制到 config\cmderpromptconfig.lua 再编辑即可:可以改颜色、单行或多行提示符、显示完整路径还是只显示文件夹、user@host 前缀、用 ~ 表示主目录以及 λ 符号。别名存放在 config\useraliases.cmd 里。
What are similar projects?oh-my-posh, Winhance, terminal, Playnite, ranger, upterm, Scoop, zx
Creator
cmderdev
Size
3.7 MB
Stars
27K
Age
13y
Commits · 90 Days