12/18/2020 Cmder For Windows
Cmder is a well-known portable terminal emulator for Windows 10 that was built from the “pure frustration” caused by the lack of a good alternative in Windows. It’s built on top of another well-known console emulator, ConEmu, and enhanced with Clink. At this time you may want to create shortcuts for Cmder on your taskbar, desktop, or start menu. You can do this by navigating back to C: cmder and right-clicking on the Cmder.exe file, where you have an option to 'Pin to Start,' 'Pin to Taskbar,' and/or 'Send to' 'Desktop (Create Shortcut).' The program is more than an alternative to your Windows default command prompt utility. It provides more tools, features, and a graphical interface which makes it easier to work with. Any user that wants a comprehensive software package and a terminal emulator will definitely want to check out Cmder.
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.
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.
InstallationSingle User Portable Config
Shared Cmder install with Non-Portable Individual User Config
Cmder.exe Command Line Arguments
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
In a file explorer window right click in or on a directory to see 'Cmder Here' in the context menu.
Keyboard shortcutsTab manipulation
Shell
(Some shortcuts are not yet documented, though they exist - please document them here)
FeaturesAccess to multiple shells in one window using tabs
You can open multiple tabs each containing one of the following shells:
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:
You may find some Monokai color schemes for mintty to match Cmder here or here.
Changing Cmder Default
|
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%vendorGit-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%binssh.exe |
/user_aliases [file path] |
File path pointing to user aliases. | %CMDER_ROOT%configuser-aliases.cmd |
/v |
Enables verbose output. | not set |
(custom arguments) | User defined arguments processed by cexec . Type cexec /? for more useage. |
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%configuser_profile.cmd |
PowerShell | $ENV:CMDER_ROOTconfiguser_profile.ps1 |
Bash/Mintty | $CMDER_ROOT/config/user_profile.sh |
![Windows Windows](https://www.belayarchitecture.com/uploads/large/WVVoU01HTklUVFpNZVRsd1RHNXNNR0ZYTVc1TWJVNTJZbE01TW1GVE9WcGhWa1p0VG0xU1FsUlVTbmxUVXpsMFdWaG9lVnBZVG10YVYxcG9aRmQ0TUV4dGNIZGFkdw/cmder/%E0%B8%9B%E0%B8%A3-%E0%B8%9A%E0%B9%81%E0%B8%95-%E0%B8%87-bash-on-window-%E0%B9%83%E0%B8%AB-%E0%B8%99-%E0%B8%B2%E0%B9%83%E0%B8%8A-%E0%B9%82%E0%B8%94%E0%B8%A2%E0%B9%83%E0%B8%8A-oh-my-zsh-%E0%B9%81%E0%B8%A5%E0%B8%B0.jpg)
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%configprofile.d
folder to add startup config to Cmder.
Shell | Cmder Profile.d Scripts |
---|---|
Cmder | %CMDER_ROOT%configprofile.d*.bat and *.cmd |
PowerShell | $ENV:CMDER_ROOTconfigprofile.d*.ps1 |
Bash/Mintty | $CMDER_ROOT/config/profile.d/*.sh |
Cmder Windows 10 Bash
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%configuser-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.
%CMDER_ROOT%configprofile.d*.cmd
and*.bat
%CMDER_ROOT%configuser-aliases.cmd
%CMDER_ROOT%configuser_profile.cmd
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.
$CMDER_ROOT/config/profile.d/*.sh
$CMDER_ROOT/config/user_profile.sh
$HOME/.bashrc
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_ROOTvendoruser_profile.ps1
. Anything stored in $ENV:CMDER_ROOT
will be a portable setting and will follow cmder to another machine.
$ENV:CMDER_ROOTconfigprofile.d*.ps1
$ENV:CMDER_ROOTconfiguser_profile.ps1
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%
enviroment 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.
![Emulator Emulator](/uploads/1/3/3/2/133280270/216021477.jpg)
You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions:
- Setup a new task by pressing Win +Alt + T.
- Click the
+
button to add a task. - Name the new task in the top text box.
- Provide task parameters, this is optional.
- Add
cmd /c '[path_to_external_env]binbash --login -i' -new_console
to theCommands
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:
Download Cmder For Windows 7
- bash - Copy to
/etc/profile.d/cmder_exinit.sh
- zsh - Copy to
/etc/profile.d/cmder_exinit.zsh
Uncomment and edit the below line in the script to use Cmder config even when launched from outside 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 thesearguments 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.
Example:
%ccall% /startnotepad start notepad.exe
%cexec%
- Evaluates flags, runs commands if found, and does not return to the calling script.
Example:
%cexec% /startnotepad start notepad.exe
It is useful when you have multiple tasks to execute
cmder
and need it to initializethe session differently depending on the task chosen.
To conditionally start
notepad.exe
when you start a specific cmder
task:
-
Press win+alt+t
-
Click
+
to add a new task. -
Add the below to the
Commands
block: -
Add the below to your
%cmder_root%configuser_profile.cmd
To see detailed usage of
cexec
, type cexec /?
in cmder.
Integrating Cmder with Hyper, Microsoft VS Code, and your favorite IDEs
Download Cmder For Windows 10
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.
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:
-
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.
- The
-
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.
- Editing files under
-
Delete the
[cmder_root]/vendor
folder. -
Extract the new
cmder.zip
orcmder_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:
-
Exit all Cmder sessions and backup
[cmder_root]/vendor/conemu-maximus5/conemu.xml
to[cmder_root]/config/user[-|_]conemu.xml
. -
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.
- Editing files under
-
Delete the
[cmder_root]/vendor
folder. -
Extract the new
cmder.zip
orcmder_mini.zip
into[cmder_root]/
overwriting all files when prompted.
Current development builds
You can download builds of the current development branch by going to AppVeyor via the following link:
Download Cmder For Windows
License
All software included is bundled with own license
Download Cmder For Windows
The MIT License (MIT)
Copyright (c) 2016 Samuel Vasko
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the 'Software'), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
How To Install Cmder For Windows
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 INTHE SOFTWARE.
Comments are closed.
Author
Write something about yourself. No need to be fancy, just an overview.