What's the difference between a console, a terminal, and a shell?
I see a lot of questions that are close but the questions themselves show an underlying misunderstanding of some important terms.
- Why would I use Windows Terminal over PowerShell?
- I don't need WSL for bash, I use Cygwin.
- Can I use conemu with PowerShell Core or do I need to use Windows Terminal?
Let's start with a glossary and clarify some words first.
Terminal
The word Terminal comes from terminate, indicating that it's the terminating end or "terminal" end of a communications process. You'll often hear "dumb terminal" when referring to a text-based environment where the computer you are sitting next to is just taking input and showing text while the real work happens at the other end in a mainframe or large computer.
TTY or "teletypewriter" was the first kind of terminal. Rather than a screen you'd have a literal typewriter in front of you. When you type on it, you're seeing the text on a piece of paper AND inputing that text into a computer. When that computer replies, you'll see the typewriter automatically type on the same paper.
When we refer to a Terminal in the software sense, we're referring to a literal software version of a TTY or Terminal. The Windows Terminal is that. It's really good at displaying textual output. It can take input and pass it on. But the Terminal isn't smart. It doesn't actually process your input, it doesn't look at your files or think.
Console
Folks in the mid 20th century would have a piece of furniture in their living room called a console or console cabinet. A Console in the context of computers is a console or cabinet with a screen and keyboard combined inside it. But, it's effectively a Terminal. Technically the Console is the device and the Terminal is now the software program inside the Console.
In the software world a Terminal and a Console are, for all intents, synonymous.
Shell
A shell is the program that the terminal sends user input to. The shell generates output and passes it back to the terminal for display. Here's some examples of Shells:
- bash, fish, zsh, ksh, sh, tsch
- PowerShell, pwsh
- cmd, yori, 4dos, command.com
Here's an important point that should make more sense now that you have these terminals - Your choice of shell doesn't and shouldn't dictate your choice of terminal application.
Aside: WSL and WSL2 (the Windows Subsystem for Linux) are a complete local Linux (or many Linuxes) that run on Windows 10. They are full and real. WSL2 ships a real Linux kernel and runs in on Windows. Cygwin is NOT a Linux. Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to Linux on Windows - but it is not Linux. It's a simulacrum. It's GNU utils compiled against Win32. It's great, but it's important for you to know what the difference is. Cygwin may let you run your bash shell scripts but it will NOT run Apache, Docker, or other real ELF-binaries and Linux apps.
Your Choice of Windows Consoles?
There are a number of shells that ship with Windows. Here's a few I'm running now. Note the "chrome" or the border and title around them? Those shells are all hosted by a the legacy Windows console you have never heard of called conhost.exe. You can go to the command prompt, type powershell, cmd, or ubuntu and any number of shells will run. Conhost does the work of input and output.
Now, forget that conhost exists, because it sucks - it's super old.
Pseudo Console, Pseudo Terminal, PTY, Pseudo TTY (ConPTY)
Pseudo Terminals are terminal emulators or software interfaces that emulate terminals. They pretend to be terminals like the ones above. *Nix systems have long had a pseudo-terminal (PTY) infrastructure and now Windows as a pseudoconsole (ConPTY) as well.
Window's new ConPTY interface is the future of consoles and terminals on Windows. If you choose a 3rd party (non-built-in) console applications for Windows, make sure it supports ConPTY and it'll be a better experience than some of the older consoles that use screen scraping or other hacks.
Back to your choice of Windows Consoles
Remembering there's a lot of shells you can use in Windows, there's a lot of 3rd party consoles you can use if you don't like conhost.exe (and you shouldn't).
- Hyper
- ConEmu
- cmder
- Console2
- ConsoleZ
- Terminus
- FluentTerminal
- ZOC
- MobaXterm
- Babun (dead)
- 4NT/jpSoftware (not free)
- Putty
- MinTTY
- Windows Terminal (free in Microsoft Store)
- XTermjs - a Typescript component that lets you integrate terminals into your apps
- VSCode includes a Terminal
- Visual Studio 2019 Preview includes a Terminal
All of these Terminals support ALL the shells above and any shells I've missed. Because a shell isn't a terminal. Pick the one that makes you happy. I use PowerShell Core and Ubuntu in WSL2 in the Windows Terminal.
Hope this helps clear things up.
Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
The contemporary definition of Shell is the user interface that exposes OS services to the user. It could be either graphical (e.g. Unity, Windows Shell) or text-based/command-line (e.g. Bash, PowerShell) "Shell" also has another less popular meaning: A software front-end of something (e.g. an Internet Explorer shell.)
Console, in Microsoft's definition, has two meanings. The widespread meaning is the set of input and output devices that operate a computer: Monitor and human interface devices (keyboard, mouse, touchpad, pen, touch screen) Remote Desktop Services uses "console" in this sense. (Even heard the phrase "to log in via console" vs. "remote login"?) The rest of the world, however, defines "console" as the input and output device for text only. Hence, a console app is a TUI app.
ConHost.exe is neither old nor legacy software. It was introduced with Windows 7. The latest version of Windows 10 (1903) uses it. Before Windows 7, csrss.exe rendered Windows TUI.
Finally, I don't see how any of these answer the three bullet points at the top. PowerShell is a scripting language, a terminal, a shell, and a backend all at once. Windows Terminal is just a terminal. Hence, the first question is valid. Earlier versions of ConEmu also did not come with PowerShell Core pre-configured in them. And Cygwin is a great alternative to WSL for running Bash if Bash is all one wants. (That bullet point is not even a question.) According to Microsoft Craig Loewen, WSL 2 needs a 64-bit system, SLAT, Hyper-V, etc.
PowerShell isn’t a console or a terminal. It’s not doing any window management or painting. Conhost OR Windows Terminal does that work and PowerShell remains headless.
As for “Shell” I’m referring to text shells, not graphical ones like explorer.
Sean - a telex connected to a computer is a TTY and the simplest possible Terminal.
It would be nice to be able to take advantage of the improved VT100 emulation of the new console and connect via USB/Serial (COMx:) to my Altair-Duino and PiDP-8 computers.
Console: physically attached I/O (keyboard and screen) to which boot and default "con" output goes to. It's where boot info showed, admin alerts, etc. This is from using VAX VMS and Unix in college on both dumb VT terminals and early Sun workstations. The console was almost always located behind locked doors, in close proximity to the computer itself.
In early PC days, when you could only have one MS-DOS command interpreter open, it made sense that this command line interface was also the console (and why things like copy con worked). Also, like a console on a big computer, you had complete access to the whole thing through this interface.
Terminal: Remote session to the computer, typically over serial or sockets, either in a window on a computer or a dedicated device like the VT220s I loved to use. These were located all over campus.
FWIW, we also had a few teletype terminals on the floor in the labs, even though they were ancient by then. In college, I played Adventure (the FORTRAN version), on a teletype connected to DEC VAX VMS, in college. :)
Shell: the interaction environment delivered by the computer: DCL, bash, csh, command.com, cmd.exe, powershell.exe, etc. Could also be graphical now, of course. But it provides a way to get to user applications on the computer. Anything beyond that is gravy.
The definitions have evolved over time, and get muddy when you're talking about all three on a single device, but in my head, I tend to stick to what I learned in college back in the day.
Pete
As such it comes with a couple of shell options, bash being the default. But you can use zsh etc. as well.
Also, it was amusing that you're referring to me as "7 - Fleet"! 😜 It's kinda cute.
And most importantly, one can never be sure that a new Windows 10 feature is actually superior to a Windows 7 feature. Not before seeing it. Ever tried installing Fiddler for in the context of a Standard user account and then uninstall it using Apps and Features? If yes, you know what I mean.
As for whether it's legacy, well that depends on what legacy means, I guess. If by legacy we mean "still present/supported due to wide-spread use, but something newer has come along to serve the same purpose" then I think that pretty accurately describes conhost.exe going forward. Importantly, I don't think "legacy" is the same as deprecation, and neither Scott nor anyone at Microsoft that I know of has said conhost is deprecated and I don't think that's likely to change as long as it's still in wide use. In fact, the team explicitly said as much:
Windows Console will continue to ship within Windows for decades to come in order to ensure backward compatibility with the many millions of existing/legacy command-line scripts, apps, and tools
But as I said before, the development focus (especially when it comes to new features) is going to be on the new Terminal, not conhost. That's clear from the way the code-base has been restructured, the work that has been done so far, and comments made by people on the command-line team. And that's really all Scott was saying: let's talk about the new terminal because the existing console is old and it does suck.
Pete has a more accurate description of consoles. These have special properties on the computer otherwise they are just a terminal line. The IBM PC may have had a shaky story as it transitioned to being a server-class machine but on proper computers the console gives you (out-of-band) access to privileged operations like halting/rebooting the machine, choosing the boot device, hardware diagnostics, direct login to administrator accounts, critical system logging including kernel panics/watchdog reboots.
Even Windows has the concept of a secure attention sequence. And have a look above those cursor keys on a typical PC keyboard, the break key lives on even if it's changed key!
I also remember a story about the implementation for serial connections sometimes using very simple polled I/O operations to try and keep the console working regardless of other system activity/bugs, perhaps that's from the mainframe era.
I can report copy con: filename still works on Windows! No ctty though :(
Comments are closed.