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

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube