News for hackers. Stuff that matters.
Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Wednesday August 15, 2018 @06:36PM (#17770351)
The ConPTY is not just about compatibility with nix. It's about proper remoting of consoles. Unix got that right / Windows got that wrong, and now Windows will finally get it right too -- that it helps nix compat seems like a happy accident (though obviously they want that too, so not so accidental.
Re:Introducing the Windows Pseudo Console (ConPty) by quotemstr on Wednesday August 15, 2018 @07:27PM (#17770637)
Right. For a long time, the MS remoting philosophy was that applications should be remoted, not text streams. The stance goes all the way back to DCOM. That's why PowerShell remoting looks more like a local PowerShell executing commands on a remote machine than it looks like you just connecting to a PowerShell running elsewhere.

The difference is important, since in the traditional MS model, each program that wants to do the remote thing needs to essentially implement its own client-server setup, albeit with a massive amount of help from various runtimes. Named pipes and central authentication made this approach not quite as horrible as it sounds.

This new API is a departure from this model. It will make it possible to just remote via text streams. Perhaps that's uglier --- everyone knows in-band signaling is fragile. But long experience shows they just remoting the damn text streams is easily the more pragmatic option.

Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Wednesday August 15, 2018 @09:55PM (#17771297)
I mean, it could be a packet stream where some packets are control packets, and then the Console API could be used and remoted, but you'd need clients that understand it.

The fragility of in-band signaling in the TTY world is not *nix's fault or anything. VMS had that too, since VMS too had to deal with TTYs. The fact is that a) the system evolved from real, hardware TTYs of the 1970s, b) using a text stream with some in-band signaling doesn't even half suck -- mostly it rocks, and all you have to do for it to rock is get the right $TERM value and not output binary files to the tty.

Re:Introducing the Windows Pseudo Console (ConPty) by quotemstr on Wednesday August 15, 2018 @10:30PM (#17771445)
Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Wednesday August 15, 2018 @10:42PM (#17771496)
The Windows Console was even more terminally dead. Terminals have their limitations, but honestly, I'll take a terminal, tty/pty, and terminfo, any day over the Windows Console.
Re:Introducing the Windows Pseudo Console (ConPty) by caf on Wednesday August 15, 2018 @10:02PM (#17771323)
You also have to sanitise untrusted data that you want to output.
Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Wednesday August 15, 2018 @10:16PM (#17771371)
And remember to use less -R or else pipe to col(1) or whatever.
Re:Introducing the Windows Pseudo Console (ConPty) by quotemstr on Thursday August 16, 2018 @12:29AM (#17771887)
I want a pipe2(2) flag or an fcntl or something that lets me signal "the other end of this pipe understands ANSI escapes"
Re:Introducing the Windows Pseudo Console (ConPty) by JdeBP on Thursday August 16, 2018 @06:50AM (#17773530)
First of all you have to define "ANSI escape".

Hints:

* You have the wrong country, on the wrong continent.

* It's not as simple in reality as your first answer will be. (-:

Re:Introducing the Windows Pseudo Console (ConPty) by quotemstr on Thursday August 16, 2018 @08:56AM (#17774187)
Yeah, I know
Re:Introducing the Windows Pseudo Console (ConPty) by caf on Thursday August 16, 2018 @12:45AM (#17771945)
I've considered before that you could allow each end of a pipe to set name/value attributes, which can be read by the other end.
Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Thursday August 16, 2018 @01:19AM (#17772112)
And now you're reinventing the Windows Console API... :)

I mean, both approaches have their pluses, but the API approach is only ever going to work well for remoting if it is standardized and interoperable. And the installed base of Unix termcap/terminfo programs is huge, so plain old text-with-in-band-controls is not going away anytime soon.

Re:Introducing the Windows Pseudo Console (ConPty) by caf on Thursday August 16, 2018 @02:33AM (#17772409)
With things like SIGWINCH / ioctl(TIOCGWINSZ) we already know what kind of API it is, we are just haggling about the price.
Re:Introducing the Windows Pseudo Console (ConPty) by loa-in-backup on Thursday August 16, 2018 @08:50AM (#17774151)
It's a difference between making mv/move, cp/copy client-server aware and making the shell running these simple utilities client-server aware.
Re:Introducing the Windows Pseudo Console (ConPty) by quotemstr on Thursday August 16, 2018 @11:45AM (#17775655)
The Windows way would be to mount the remote filesystem and use local mv and cp. Which works fine, since Windows has excellent remote filesystem support. The Unix world only partially began to catch up to CIFS with the advent of NFSv4 and its lease infrastructure and it still isn't as seamless as the Windows stuff.