/>
X

Six Clicks: Windows 10's Command Line 2.0

Windows command line power users get an upgraded shell in the Windows 10 Technical Preview.
0-windows10-console-upgrades.jpg
1 of 7 Larry Seltzer/ZDNet

It's alive! It's alive!

The CMD.EXE shell in Windows is certainly the most neglected important component of Windows. Even when it came out it wasn't particularly advanced, and advanced users have moved on to better things over the years. Now, with Windows 10, Microsoft has decided that it's time to throw a few volts into the old shell and bring it back to life.

Or, as Microsoft explains it at their developer feedback site:

In the dawn of time, the original Windows console was created. For millennia, geeks and developers (typically both) steeled their nerves and leveraged the console's utility. After a (very) short time, a great lacking was noticed. And so, legions of ever intrepid command line mavens migrated to other platforms and other consoles, 'til but a stalwart few remained. Now, today, with a small rumbling, the ancient, weary console heaves a great sigh and rises. The journey to legitimacy has begun. WE'RE BACK!

Don't take ominous movie trailer language too seriously. CMD is not suddenly on par with any of the great UNIX shells, but if you use the shell you will appreciate the improvements.

These new features are not turned on by default. As shown in this image, you must first enable them in the 'Experimental' tab of the Command Prompt properties window.

The term "shell" and "console" are often used interchangeably, but they aren't the same thing in Windows. The Console is conhost.exe, a process which performs many of the basic functions of shells, such as accepting keyboard and mouse input, displaying character output, presenting the Console APIs and so on. CMD.EXE, PowerShell other shell programs are generally character mode programs that run within the context of conhost.exe. The changes announced for the command line are all in conhost.exe and therefore apply to all shell programs, including PowerShell. But if the changes present a problem to a shell program, there's an easy way to use the old conhost instead.

Note carefully that these are experimental and that they are not necessarily a final feature set. Microsoft expects to keep adding features up to and even after Windows 10 goes 'final.' I also recommend a Microsoft blog on the new shell features.

(Image ZDNet/CBS Interactive Inc.)

1-windows10-console-upgrades.jpg
2 of 7 Larry Seltzer/ZDNet

Stretchy shell windows

The Windows shell was designed back at a time when most of us got 800x600 resolution on a good day. One lazy assumption made by the console authors back then, and unchanged until now, is that the size of the window buffer was fixed for the session. You couldn't make it any wider.

In the example shown here I type out a file at one screen size, widen the window past its settings, and type it again. Windows assumes, when I stretch the window out, that I want to grow its buffer size.

Note also that the console also has word wrap, like every other text-handling program in the world.

(Image ZDNet/CBS Interactive Inc.)

2-windows10-console-upgrades.jpg
3 of 7 Larry Seltzer/ZDNet

Better clipboard support

You have always been able to copy and paste in the Windows shell, but it was an awkward process. Nearly all of it had to be done with selections on the system menu for the shell instance. In Windows 10 you have many more options.

By default, you can bring that same context menu (the one with Mark, Copy, Paste, Select all, Scroll and Find) with a right-click on the window. If you select the new "QuickEdit Mode" in Console Properties, right-click does a paste.

Clipboard keystrokes work in the console now! See the table of keys below from Microsoft.

Editing Key Combination   Description
CTRL + V   Paste text into the command line.
CTRL + INS   Copy selected text to the clipboard.
CTRL + C   Copy selected text to the clipboard.
SHIFT + INS   Paste text into the command line.
CTRL + X   Cut selected text to the clipboard. This is not yet implemented.
Any Key when Text Selected   Delete text (and replace with key if appropriate) – not yet implemented

In the image on this page, I selected the command text I had echoed and pasted it at the command line.

(Image ZDNet/CBS Interactive Inc.)

3-windows10-console-upgrades.jpg
4 of 7 Larry Seltzer/ZDNet

Transparency

As you can see, you can set the transparency level of the console window. Rafael Rivera, a famous Windows engineer, doesn't see the point and thinks it's in there just for wow factor. But I can think of examples where I want to use the screen for a console but want to be able to see what's going on in the window beneath. In the example on display here, I'm tracking the playoff game between the Royals and Orioles.

(Image ZDNet/CBS Interactive Inc.)

4-windows10-console-upgrades.jpg
5 of 7 Larry Seltzer/ZDNet

Better keyboard editing and selection

Many keystrokes are now available in the console for selecting text and navigating the console buffer. The image on this page shows how it is possible to make selections by character or line, not just by block. The tables below show some of the other new keystrokes. Some are not implemented and some that are supposed to be implemented didn't work in my testing.

Text Selection Key Combinations   Description
SHIFT + LEFT ARROW   Moves the cursor to the left one character, extending the selection
SHIFT + RIGHT ARROW   Moves the cursor to the right one character, extending the selection
SHIFT + UP ARROW   Selects text up line by line starting from the location of the insertion point
SHIFT + DOWN ARROW   Extends text selection down one line, starting at the location of the insertion point
SHIFT + END   If cursor is in current line being edited
  • First time extends selection to the last character in the input line
  • Second consecutive press extends selection to the right margin
Else selects text from the insertion point to the right margin
SHIFT + HOME   If cursor is in current line being edited
  • First time extends selection to the character immediately after the command prompt.
  • Second consecutive press extends selection to the left margin
Else extends selection to the left margin
SHIFT + PAGE DOWN   Extends selection down one screen
SHIFT + PAGE UP   Extends selection up one screen
CTRL + SHIFT + RIGHT ARROW   Extends the selection one word to the right *
CTRL + SHIFT + LEFT ARROW   Extends the selection one word to the left *
CTRL + SHIFT + HOME   Extends selection to the beginning of the screen buffer
CTRL + SHIFT + END   Extends selection to the end of the screen buffer
CTRL + A  

If cursor is in current line being edited and line is not empty, selects all text after the prompt

Else selects the entire buffer


Editing Key Combinations   Description
CTRL + V   Pastes text into the command line
CTRL + INS   Copies selected text to the clipboard
CTRL + C   Copies selected text to the clipboard
SHIFT + INS   Pastes text into the command line
CTRL + X   Cuts selected text to the clipboard. This is not yet implemented.
Any Key when Text Selected   Deletes text (and replace with key if appropriate). This is not yet implemented

Mark Mode Key Combinations   Description
CTRL + M   Enter "Mark Mode" to move cursor within window.
ALT   In conjunction with one of the selection key combinations, begins selection in block mode
ARROW KEYS   Moves cursor in the direction specified
PAGE KEYS   Moves cursor by one page in the direction specified
CTRL + HOME   Moves cursor to beginning of buffer
CTRL + END   Moves cursor to end of buffer

History Navigation Key Combinations   Description
CTRL + UP ARROW   Moves up one line in the output history
CTRL + DOWN ARROW   Moves down one line in the output history
CTRL + PAGE UP   Moves up one page in the output history
CTRL + PAGE DOWN   Moves down one page in the output history
CTRL + HOME   Moves cursor to beginning of buffer. Not implemented
CTRL + END   Moves cursor to end of buffer. Not implemented

Other Key Combinations   Description
CTRL + F   Opens "Find" dialog
ALT + F4   Closes the console window

Transparency Combinations   Description
CTRL + SHIFT + Plus (+)   Increases transparency
CTRL + SHIFT + Minus (-)   Decreases transparency
CTRL + SHIFT + (Mouse) SCROLL UP   Increases transparency
CTRL + SHIFT + (Mouse) SCROLL DOWN   Decreases transparency


Image ZDNet/CBS Interactive Inc. Tables courtesy Microsoft.

5-windows10-console-upgrades-v1.jpg
6 of 7 Larry Seltzer/ZDNet

Miscellaneous: Tab filtering, leading zero trimming, ETC.

There are a bunch of other more obscure improvements. One of them, awkwardly demonstrated in this image, is that the console paste filters out tabs and turns fancy quotation marks into plain ones.

(Image ZDNet/CBS Interactive Inc.)

6-windows10-console-upgrades.jpg
7 of 7 Larry Seltzer/ZDNet

Most-requested features

On the Windows Developer Feedback site, users get to vote on features they want added to the Windows 10 shell. Here are the top ones so far:

  • Tabbed Interface (979 votes): This is the number one most requested feature by quite a bit, and it's not hard to see why. If you have multiple Windows shells open, they're all in different Windows and can get difficult to track. Michael from the Microsoft Console Team says in the comments that he wants this too, but they have to think about it carefully, as a lot can go wrong with it. For an example of an open source replacement Windows shell, displayed on this page, is bozho's Console.
  • SSH (667 votes): SSH, a secure and encrypted shall, is an important tool for administration of many systems. Microsoft says they want to do this and are working on it, but it's worth pointing out that there is a free and open source SSH for Windows available.
  • Bash-Style Autocomplete (628 votes): The UNIX Bash shell, best known recently as the source of the Shellshock bug, has autocomplete capabilities well beyond those of CMD (although Windows PowerShell has similar capabilities).
  • ANSI Colors (550 votes): This is a system of escape sequences to the shell to make changes in color and some related characteristics. It's popular because it can make shell-based interfaces easier to read. In fact, back in the stone age, Windows included a device driver (ANSI.SYS) that supported this, but it went away at some point. Microsoft says it's on their backlog list, but so are a lot of other things. In the meantime, there are third-party solutions, such as ANSICON.
  • Popular UNIX Tools (498 votes): This idea is basically decades old. Microsoft has attempted to provide some level of UNIX compatibility since the dawn of Windows NT, which included a POSIX-compliant environment. Microsoft had included the Subsystem for UNIX Applications (SUA), a UNIX environment with many of the tools users want, with the Windows distribution through Windows 8 (it was always an optional, non-default installation), but it has been deprecated and is no longer there. I personally think this is more trouble than it's worth. Users who want UNIX tools on Windows have several good options (like Cygwin) and a standard distribution would just break a lot of scripts that users have from such third-party tools.
  • Open Source (378 votes): Perhaps this isn't as ridiculous a request as it would have been many years ago, as Microsoft releases lots of open source code. But that code is not often part of the Windows operating system. The Microsoft Console Team points out that it would be a lot more complicated than just putting the files in an internet-accessible directory. The program is built with internal tools as part of a larger Windows build system. It's also often the case (although I don't know if it is here) that such programs are copyrighted by third parties who have licensed it to Microsoft for use, but not for source release.
  • Retain History Between Sessions (349 votes): Definitely a very cool idea. The Microsoft Console team says that there are problems to work out before it could be done, but they like it too.
  • Dump CMD, Move To PowerShell (308 votes): PowerShell is a popular shell from Microsoft, much better suited to Windows systems programming, but it has a steep learning curve and is incompatible with scripts written for CMD. The suggestion is not a reasonable one, as it entitles giving users less choice than they have now.
  • UTF-8(306 votes): UTF-8 is the character set used largely on the web (very often you'll see "<meta charset="UTF-8" />" in the HEAD section) and by many popular tools for processing HTML. But Windows, including the console, uses UTF-16, and this causes problems for developers who need to write command line programs that use process HTML. Microsoft says they understand the need, but that it would be very hard to do.
  • Full-Screen Interface (278 votes): There actually used to be a full-screen command line mode, but it went away. The Microsoft Console Team expresses sympathy for this request and says they are working on it.

(Image courtesy SourceForge)

Related Galleries

Jabra PanaCast 20 review: in pictures
jabra-panacast-20-1.jpg

Related Galleries

Jabra PanaCast 20 review: in pictures

9 Photos
Satechi USB-C Hybrid Multiport adaptor
Satechi USB-C Hybrid Multiport adaptor

Related Galleries

Satechi USB-C Hybrid Multiport adaptor

10 Photos
First Look: New Surface PCs include Android-based Duo 2 [in pictures]
thumbnail-72371d1d9eb043bcb3986b87c5b47dc7.jpg

Related Galleries

First Look: New Surface PCs include Android-based Duo 2 [in pictures]

12 Photos
Installing and running Windows 11 on a Mac
Starting the Windows 11 installation

Related Galleries

Installing and running Windows 11 on a Mac

20 Photos
YubiKey 5C NFC: The world’s first security key to feature dual USB-C and NFC connections
YubiKey 5C NFC

Related Galleries

YubiKey 5C NFC: The world’s first security key to feature dual USB-C and NFC connections

9 Photos
Parallels Desktop 16 for Mac
Parallels Desktop 16 for Mac

Related Galleries

Parallels Desktop 16 for Mac

9 Photos
Apricorn Aegis Secure Key 3NXC
Apricorn Aegis Secure Key 3NXC

Related Galleries

Apricorn Aegis Secure Key 3NXC

12 Photos