News

Microsoft Answers Developer Calls for Linux-Like Pseudo Console in Windows

"We've heard from many, many developers, who've frequently requested a PTY-like mechanism in Windows," said Microsoft exec Rich Turner in a recent blog post announcing a Windows Pseudo Console (ConPTY) coming to Windows 10.

This "back to the future" move will make it easier for developers to connect their command-line and graphical user interface (GUI)-based applications. Turner said the many developers requesting such functionality included those who work on developing the Visual Studio IDE and the Visual Studio Code editor, along with terminal and command-line coders.

Unlike *NIX operating systems, Windows currently lacks a pseudo console. It doesn't speak the "text/VT" language that was used to support terminal communications in *NIX operating systems. As a consequence, Windows currently "obstructs third-party consoles and server apps." Windows goes through the gyrations of creating an off-screen console to scrape and resend the output using a so-called "Console API."

This lack of a pseudo console in Windows has just led to problems, including "instability, crashes, data corruption, excessive power consumption," among others, according to Turner, a senior program manager at Microsoft, in an Aug. 2 post announcing the coming Windows Pseudo Console. The Windows Pseudo Console API is aiming to remove those obstacles.

"Our goals here are to eradicate an entire class of issues and limitations for developers of Console and server apps, and to make developing code for the Windows Command Line infrastructure more powerful, consistent, and fun," Turner wrote.

Turner has been writing a series of posts about the Windows command line. His Windows Pseudo Console announcement recounted how terminal communications have evolved over the years. They've shifted from dumb terminals where people typed input using typewriter-like devices to PCs with screens and graphical displays. The pseudo console was added in *NIX operating systems as solution to teletype machines getting scrapped.

Microsoft's new Windows Pseudo Console aims to make the current ConHost in Windows "a true Console Host," Turner indicated. Microsoft expects to ship the new Windows Pseudo Console "in the next major release of Windows 10 (due sometime in fall/winter 2018)," he added. It's presently available for testing in the latest Windows 10 Insider Preview SDK.

Microsoft has already shifted some of its tools to use the new ConPTY API. The console team at Microsoft has collaborated with internal Microsoft teams on integration efforts, such as the teams developing Windows Subsystem for Linux, Windows Containers, Visual Studio and VSCode, along with "third-party" (non-Microsoft) developers.

Developers of command-line applications won't have to do much as the new "ConHost will do all the work for you," Turner indicated. They also can continue to use the old Console API if they want. However, Microsoft is encouraging developers to use the new ConPTY API if they are building new Windows command-line applications.

Turner indicated that the Windows Pseudo Console in Windows 10 will fix problems currently associated with connecting command-line applications in Windows. It will support "all Command-Line and/or GUI applications that communicate with Command-Line applications," he added. It'll also provide backward compatibility for existing command-line apps, he suggested. Command-line apps will "speak text/VT externally, without requiring any changes."

"Using the new ConPTY infrastructure, third party Consoles can now communicate directly with modern and traditional Command-Line applications, and speak text/VT with all of them," Turner noted.

Despite the historical baggage associated with it, Turner described Microsoft's switch to the ConPTY API as "perhaps one of the most fundamental, and liberating, changes that's happened to the Windows Command-Line in several years … if not decades!"

About the Author

Kurt Mackie is senior news producer for 1105 Media's Converge360 group.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube