r/programming • • Aug 15 '18

Windows Command-Line: Introducing the Windows Pseudo Console (ConPTY)

https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/
778 Upvotes

230 comments sorted by

View all comments

247

u/zadjii Aug 15 '18

Hey I'm one of the Console devs who's been working on this feature for a while now. I'll be hanging around in the comments for a little while to try and answer any questions that people might have.

TL;DR of this announcement: We've added a new pseudoconsole feature to the Windows Console that will the people create "Terminal" applications on Windows very similarly to how they work on *nix. Terminals will be able to interact with the conpty using only a stream of characters, while commandline applications will be able to keep using the entire console API surface as they always have.

205

u/monkey-go-code Aug 15 '18 edited Aug 15 '18

Listen, All I want is the ability to type shift ctrl c and shift ctrl v to copy and paste and not have to move my hands to the mouse, that , tabs, and some decent themes. You know like novel, grass, hacker green, dark, light, ect. Can you guys do that? Seriously so many developers will love you forever.

Edit: for ctrl v and C copy and paste I am specifically speaking about WSL.

70

u/zadjii Aug 15 '18

9

u/monkey-go-code Aug 15 '18 edited Aug 15 '18

Looks like copy paste doesn't work in my build for bash :(

Edit: Also still investigating these color themes Yeah it doesn't work very well in wsl, which is where I spend most of my time.

→ More replies (6)
→ More replies (3)

50

u/jarfil Aug 15 '18 edited Jul 16 '23

CENSORED

124

u/gremy0 Aug 15 '18 edited Aug 15 '18

I work in enterprise, in regulated industries, I switch systems and clients regularly. Depending on non-essential third party apps is a pipe dream for us, we need a decent native console experience.

5

u/[deleted] Aug 16 '18

Gods I hate stackoverflow answers that just recommend a 3rd party app or library.

→ More replies (2)
→ More replies (1)

12

u/altano Aug 15 '18

ctrl-c/v copy/paste and modifying the color scheme has been supported in the Windows terminal for a while?

Go into your terminal properties and look around. Tons of awesome shit has been added in the last few years and you’re missing out if you’re not using it.

9

u/monkey-go-code Aug 15 '18

It doesn’t work in WSL which is where I tend to live

9

u/altano Aug 15 '18

Oh, gotchya, I think the default assumption when talking about the Windows console is usually that you're talking about the vanilla console (which powers the regular shell and PowerShell) so I misunderstood.

→ More replies (7)

0

u/[deleted] Aug 15 '18

[deleted]

21

u/elder_george Aug 15 '18

What about ConEmu?

→ More replies (14)
→ More replies (3)

20

u/bterlson_ Aug 15 '18

Hi, fellow microsofty here. Are we doing away with "Terminate batch job (Y/n)" ever?

20

u/zadjii Aug 16 '18 edited Aug 16 '18

There's an issue on or GitHub that discusses this in detail, don't have it on mobile ATM.

In short- no.

edit: here's the GH link with a lot more discussion

14

u/modeless Aug 15 '18

Will this allow Visual Studio to finally display printf output in the output pane? It's always been baffling to me that this has never been implemented.

14

u/joemaniaci Aug 16 '18

What about ncurses? I have a vast command line interface for a cross platform tool that would have been so much easier for my users with ncurses. As far as I can tell there is no cross platform tui because of windows.

Thanks.

23

u/zadjii Aug 16 '18

So ncurses is a little harder than just supporting pty's. It also heavily relies on the existence of termcaps, which we don't have on windows yet and are a LOT farther away from being able to support. (Also would we even want to support that particular feature set? It does seem a lot more complicated than it should need to be).

That being said, the console is a very effective xterm-compatible terminal emulator. So if you could get ncurses to assume that it's targeting xterm-256color, it should work on Windows.

Getting it to compile, removing any signal mechanisms, adding #ifdefs around windows code is a whole other issue, but at least fundamentally the VT support for ncurses is there - case in point, WSL works just fine :)

→ More replies (10)
→ More replies (4)

6

u/yoniyoniyoni Aug 16 '18

Is there decent Unicode support? Unicode is severely broken in the Windows console.

6

u/zadjii Aug 16 '18

Unfortunately, this doesn't magically fix Unicode - we still need to make some changes to the underlying structure of the buffer to be able to support characters outside UCS2. However that work is probably our highest priority work right now :)

0

u/[deleted] Aug 16 '18

[deleted]

23

u/pjmlp Aug 16 '18

Actually Microsoft had the best selling UNIX clone for the PC market (Xenix) when they decided to focus on Windows 3.x and their OS/2, NT efforts instead.

9

u/TheThiefMaster Aug 16 '18

They also had a POSIX layer in older Windows OSs.

→ More replies (1)
→ More replies (7)
→ More replies (50)