Live data from Hacker News

Introducing the Windows Pseudo Console (ConPty)

blogs.msdn.microsoft.com

131–140 of 196 posts

Re: Introducing the Windows Pseudo Console (ConPty)

#131
post #109

Earlier quoted context omitted.

Yes, of course signals are easily the worst thing in Unix, but job control is nice .

It's already there: https://docs.microsoft.com/en-us/windows/desktop/ProcThread/... You can set various limits, though I haven't seen functions to stop/resume a job.

You can suspend and resume threads, so if you model your jobs with processes that could be used for that, I guess.

Re: Introducing the Windows Pseudo Console (ConPty)

#132
Is there any way to get this backported to Windows 7 - or run a W7 userland on top of a W10 kernel? I'm actually serious about this one, I can't stand this semi-"mobile-first", flat UI of newer Windows generations, and the privacy invasions and ads are other hard blockers for me - but that WSL layer or the new console subsystem seem to be pretty nice features.

Re: Introducing the Windows Pseudo Console (ConPty)

#133

This is pretty huge. For as long as I can remember the response to command line applications talking to command line applications was "Why would you want to do that? Use (RPC | shared memory | some other IPC mechanism)." And nobody at Microsoft seemed to understand how much simpler it was to use ptys. They seem to have completely capitulated to the notion ptys and are dropping them into the next release of W10. I wis…

26 years ago.

Which is : https://en.wikipedia.org/wiki/Windows_3.1x

Re: Introducing the Windows Pseudo Console (ConPty)

#134
post #29

Earlier quoted context omitted.

cmd is parked for pretty much everything except for major issues. It's a scary codebase that has a LOT of code that's dependent on it, and we can't really add any new features there without the possibility of breaking someone. This feature is mostly focused on the other end of the communication, on being able to create new Terminal windows to run shells inside of them.

Any chance that you could just fork it? Create cmd2.exe, hell you could even open-source it.

Isn't that basically Powershell?

Re: Introducing the Windows Pseudo Console (ConPty)

#135
post #60

Earlier quoted context omitted.

UTF-16 is garbage. Windows is stuck with it because it was too early an adopter of Unicode. Oh the irony. This may set Windows on a path to deprecating UTF-16 -- godspeed!

Could you elaborate? I've been under the guise for most of my career that doubling a digit leads to huge benefits that I'm too comp-sci ignorant to understand.

Joel Spolsky's essay "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)" is an excellent read:

https://www.joelonsoftware.com/2003/10/08/the-absolute-minim...

Re: Introducing the Windows Pseudo Console (ConPty)

#136
post #103

Earlier quoted context omitted.

UTF-16 has a limit on the size of a code point because a code point is either a single normal code unit or a pair of surrogate code units, each encoding 10 bits of the code point (I think I used the right terminology). UTF-8 has a natural extension path to up to 7-byte encodings with all the usual UTF-8 properties (first code unit indicates how many remain, other code units are recognizable as not the first).

Where are you getting this information though? I haven't worked out the bits myself yet but Wikipedia's first sentence itself says UTF-16 can encode all 1,112,064 valid code points of Unicode, which is already more than 2^(10+10) = 1,048,576.

Unicode code point space: Was 16-bit (0000 to FFFF), then 32-bit (00000000 to FFFFFFFF), and is now 21-bit (00000000 to 0010FFFF)

UTF-16: Encodes the entire 21-bit range, encoding most of the first 0000 to FFFF range as-is, and using surrogate pairs in that range to encode 00010000 to 0010FFFF. The latter range is shifted to 00000000 to 000FFFFF before encoding, which can be encoded in the 20 bits that surrogate pairs provide. This is a subtlety that one likely does not appreciate if one learns UTF-8 first and expects UTF-16 to be like it.

UTF-8: Could originally encode 00000000 to 7FFFFFFF, but since the limitation to just the first 17 planes a lot of UTF-8 codecs in the real world actually no longer contain the code for handling the longer sequences. Witness things like the UTF-8 codec in MySQL, whose 32-bit support conditional compilation switch is mentioned at https://news.ycombinator.com/item?id=17311048 .

Re: Introducing the Windows Pseudo Console (ConPty)

#137
post #122
post #111

-- Those who don't understand Unix are condemned to reinvent it, poorly. Henry Spencer

This is such a cliché. Do you think that the people who implemented the Windows Console, especially the people working on Windows NT, did not know about Unix? People try different approaches, sometimes they don't work out. And it's not like Unix is the Word of God, anyway, it has plenty of flaws. (Yeah, after a long time on internet forums I get kind of touchy after someone copy-pastes the same old and tired line.)

Microsoft understood Unix very well, Xenix was a product of theirs in the 80’s

Re: Introducing the Windows Pseudo Console (ConPty)

#138
post #60

Earlier quoted context omitted.

Could you elaborate? I've been under the guise for most of my career that doubling a digit leads to huge benefits that I'm too comp-sci ignorant to understand.

UTF-16 has a bit of a funky design (using four byte/two code unit surrogate pairs to encode code points outside the basic multilingual plane) that ultimately restricts Unicode (if compatibility is to be maintained with UTF-16, at least) to 17 planes, or 2^20 code points (about 1 million). UTF-8 uses a variable length encoding that allows for more characters-- if restricted to four bytes, it allows for 2^21 total code…

That is a bit misleading to the point of error, on several points:

* Your timeline is backwards. UTF-8 was designed for a 31-bit code space. Far from that being its future, that is its past. In the 21st century it was explicitly reduced from 31-bit capable to 21 bits.

* UTF-16 is just as standard as UTF-8 is, it being standardized by the same people in the same places.

* 17 planes is 21 bits; it is 16 planes that is 20 bits.

Re: Introducing the Windows Pseudo Console (ConPty)

#139

Earlier quoted context omitted.

> I've been under the guise for most of my career that doubling a digit leads to huge benefits that I'm too comp-sci ignorant to understand. I was confused about this for years, too. But it turns out it's just a problem of bad naming . Happens more in this industry than we'd like to admit. As other explained, it boils down to UTF-16 being 16-bit, and UTF-8 being anything from 8- to 32-bit. It should have been named U…

UTF-16 is a variable-length encoding using up to two code units which each are 16-bits wide. UTF-8 is a variable-length encoding using up to 4 code units (though it used to be up to 6, and could again be up to 6) each of which are 8-bits wide. Both, UTF-16 and UTF-8 are variable-length encodings! UTF-32 is not variable-length, but even so, the way Unicode works a character like ´ (á) can be written in two diffe…

For completeness sake: the confusing part is that there is (used to be) a constant-length encoding that uses the exact same codepoints as UTF-16, but doesn't allow the variable-length extensions. That encoding is called UCS-2 and although deprecated, is the reason why many people think UTF-16 is constant-length.

Re: Introducing the Windows Pseudo Console (ConPty)

#140

Earlier quoted context omitted.

And remember to use less -R or else pipe to col(1) or whatever.

I want a pipe2(2) flag or an fcntl or something that lets me signal "the other end of this pipe understands ANSI escapes"

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. (-:

Post reply on HN