What is the shell exactly when using Cmder on Windows?

I've just started using Cmder on Windows 7 and I understand that is a console emulator for Windows which gives a better experience than using cmd. However as I understand it the emulator needs to run a shell in order to communicate the user commands to the OS, so on windows what is the shell here? is CMD the default shell for Windows?

Would appreciate just understanding how these tools are connected.

5

1 Answer

Windows comes with two command-line shells built-in: Cmd.exe and PowerShell 5. (The Windows GUI is indeed a "shell" in one sense, but it is not a command shell, and not applicable to the question.)

Cmder uses Cmd.exe by default, but heavily customizes it – the actual interactive prompt that you see isn't a normal Cmd.exe prompt; it is shown by ConEmu's clink which gets injected into the Cmd process. (The whole "Cmder" window is actually ConEmu.)

So technically all your commands still run through Cmd, but it is the injected Clink library that provides advanced features like tab-completion and Readline-like keybindings.

But besides Cmd.exe, it is possible to run any other shell in Cmder, such as PowerShell or Bash (which isn't part of Windows, but is standard on Linux and often gets installed along with Git For Windows as well).

However as I understand it the emulator needs to run a shell in order to communicate the user commands to the OS

In a sense yes, although shells aren't necessary to just "run" commands (any process can start any .exe file at any time; that's how one creates a shell in the first place); rather their job is to interpret commands – they provide things like if/for/while loops, %variable% expansion, etc. Besides that, however, they do not have any special access to OS facilities that other programs wouldn't.1

(So in theory, a terminal could display its own prompts and implement its own command language, it's just rarely done because most people are quite used to e.g. the Bash syntax.)


1 (This applies to Windows and all Unix-like systems, but not neccessarily to all operating systems. For example, the DCL command shell in OpenVMS is actually more privileged than normal programs, as was the case in many operating systems at the time – it was likely Unix that broke the tradition, with its shell being a completely normal and replaceable tool.)

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like