News for hackers. Stuff that matters.
Re:Introducing the Windows Pseudo Console (ConPty) by llampx on Wednesday August 15, 2018 @05:06PM (#17769789)
Will this replace Command Prompt or Powershell? Or is this more the back-end for these apps? I believe that we are heading for console overload (in a good way?!) with Command Prompt and Powershell installed on every computer and Debian/Ubuntu available on the MS store.
Re:Introducing the Windows Pseudo Console (ConPty) by zadjii on Wednesday August 15, 2018 @05:36PM (#17769990)
First off: command prompt (cmd.exe) and powershell are commandline client applications. They are shells just the same as bash is.

All commandline clients run attached to a console server, and that server is conhost.exe. Conhost is responsible not only for being the console server, but drawing the actual terminal window these apps run in. So when you alunch cmd or powershell, what you're seeing is conhost.exe "hosting" these console applications.

What we're exposing here is the "master side" of conhost, which will the other applications act as Terminals, like how there is gnome-terminal, xterm, terminator, etc on linux.

Re:Introducing the Windows Pseudo Console (ConPty) by paulie_a on Wednesday August 15, 2018 @07:36PM (#17770677)
Is there any chance cmd and powershell will improve from a user interface perspective? And perhaps become usable? Cmd has been garbage since it's inception.
Re:Introducing the Windows Pseudo Console (ConPty) by zadjii on Wednesday August 15, 2018 @07:50PM (#17770738)
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.

Re:Introducing the Windows Pseudo Console (ConPty) by elFarto on Thursday August 16, 2018 @03:14AM (#17772581)
Any chance that you could just fork it? Create cmd2.exe, hell you could even open-source it.
Re:Introducing the Windows Pseudo Console (ConPty) by oblio on Thursday August 16, 2018 @04:32AM (#17772952)
Is the pay-off big enough? Who knows what garbage code they might want to hide in there, for both technical reasons (including security) or even legal ones.
Re:Introducing the Windows Pseudo Console (ConPty) by llampx on Thursday August 16, 2018 @06:20AM (#17773395)
Isn't that basically Powershell?
Re:Introducing the Windows Pseudo Console (ConPty) by paulie_a on Wednesday August 15, 2018 @08:36PM (#17770973)
Is there a chance this will be connected to a functional shell interface. I get your point that cmd cannot be upgraded because of legacy issues and that is understandable and unfortunate, but windows needs a proper shell. This is obviously a great start for one side of the equation. But until there is a decent terminal app, windows will continue to be a nonstarter.
Re:Introducing the Windows Pseudo Console (ConPty) by zadjii on Wednesday August 15, 2018 @08:48PM (#17771028)
It sounds like you're asking for two different things here:

cmd.exe is a shell, and that's the guy that's parked.

conhost.exe is a terminal, and that's under active development, though it's slower than something like VsCode, because we can't just go adding features as we see fit, we have a LOT of back compat we still need to support.

Fortunately, conpty will allow for the creation of new terminal applications on Windows. If you're looking for a better shell experience on windows, I can point you to powershell or even [yori](http://www.malsmith.net/yori/), which looks pretty cool

Re:Introducing the Windows Pseudo Console (ConPty) by cryptonector on Wednesday August 15, 2018 @10:18PM (#17771380)
I think u/paulie_a is just asking for a better shell. If cmd can't be made better, then make a new one.
Re:Introducing the Windows Pseudo Console (ConPty) by cwyers on Thursday August 16, 2018 @12:47AM (#17771959)
That's Powershell.
Re:Introducing the Windows Pseudo Console (ConPty) by paulie_a on Thursday August 16, 2018 @12:37AM (#17771926)
Exactly, I understand there are different underlying concepts and systems to the front end and what it interacts with. It just seem incredible that windows is basically stuck with a windows 95 interface for a shell.
Re:Introducing the Windows Pseudo Console (ConPty) by nailer on Thursday August 16, 2018 @02:54AM (#17772502)
Powershell is open source, the 6.1 preview 4 is nice and fast, and you get real objects with keys rather than scraping for regexs all the time like bash.
Re:Introducing the Windows Pseudo Console (ConPty) by AnIdiotOnTheNet on Wednesday August 15, 2018 @10:26PM (#17771432)
Windows has a proper shell, it's called PowerShell and it is by far the most discoverable and consistent shell that exists.
Re:Introducing the Windows Pseudo Console (ConPty) by wtallis on Wednesday August 15, 2018 @10:43PM (#17771506)
It's also the most absurdly verbose shell that exists, which means it sucks as a shell even if it's a half-decent scripting language.
[dead]
Re:Introducing the Windows Pseudo Console (ConPty) by wtallis on Thursday August 16, 2018 @12:06AM (#17771786)
Powershell doesn't get any credit for the tab completion when the default behavior for it just makes the verbosity even more of a nuisance. Having tab completion scroll through all the possible completions one at a time doesn't save keystrokes in most cases, especially when there are dozens or hundreds of options that are really long so when you give up on tab completion and decide to type it out manually in full, you have to erase 10-20 characters. The bash-style completion behavior of completing any unambiguous characters then giving you a list of the possibilities would be even more useful for powershell than it is for bash. But Microsoft once again had to throw in gratuitous differences at the cost of usability.
Re:Introducing the Windows Pseudo Console (ConPty) by nailer on Thursday August 16, 2018 @02:59AM (#17772519)
I prefer the way bash did it too, so I choose to do the same on powershell:

http://stackoverflow.com/questions/39221953/can-i-make-power...

    Set-PSReadlineKeyHandler -Chord Tab -Function MenuComplete
Re:Introducing the Windows Pseudo Console (ConPty) by AnIdiotOnTheNet on Thursday August 16, 2018 @12:17AM (#17771831)
That's subjective opinion. I much prefer the Windows way because I can either specify additional characters or keep hitting tab to until what I want comes up. "Display all 1026 possibilities? (y or n)" certainly isn't an improvement.

Not to mention of course that it tab completes things bash can't and doesn't, and all the other reasons your initial comment was wrong.

Re:Introducing the Windows Pseudo Console (ConPty) by wtallis on Thursday August 16, 2018 @02:13AM (#17772342)
> I much prefer the Windows way because I can either specify additional characters or keep hitting tab to until what I want comes up.

You can't specify additional characters until after you've erased all of the incorrect trailing characters that powershell filled in, and that's where powershell's completion method runs up the keystroke count unreasonably. Your comparison isn't valid if you ignore that aspect. It's also not very subjective at all. We're talking about objectively countable keystrokes.

I will concede that out of the box bash doesn't offer completion for anything other than file and command names, but it does include a programmable completion feature and many packages provide completion rules for their commands. It's up to the distro to determine whether to enable all of those completion rules by default or to stick with the more limited but predictable file-only completion behavior.

Aside from that, I can't see what "all the other reasons your initial comment was wrong" are; you appear to have only cited the existence of concise aliases for some commands as a refutation, and that obviously doesn't put powershell ahead of bash in any way, just lessens the severity of that downside.

Re:Introducing the Windows Pseudo Console (ConPty) by AnIdiotOnTheNet on Thursday August 16, 2018 @07:08AM (#17773605)
> you appear to have only cited the existence of concise aliases for some commands as a refutation

You claim that PowerShell is overly verbose, I point out that it is only verbose if you intentionally make it verbose for readability, you proceed to pick nits and pretend you've done some elaborate study on keystroke counts or something, then resort to tired old Linux evangelism mainstays like blaming the distro.

Re:Introducing the Windows Pseudo Console (ConPty) by contextfree on Friday August 17, 2018 @01:45PM (#17784523)
PS doesn't just have concise aliases for some commands, it has a coherent system of concise aliases, based on the verb-noun convention.
Re:Introducing the Windows Pseudo Console (ConPty) by paulie_a on Thursday August 16, 2018 @01:40AM (#17772204)
I've attempted to use powershell numerous times, it's a piece of shit compared to zsh.
Re:Introducing the Windows Pseudo Console (ConPty) by tokyodude on Wednesday August 15, 2018 @08:30PM (#17770945)
some other HN thread recommended cmder. I haven't touched cmd since

http://cmder.net/

Re:Introducing the Windows Pseudo Console (ConPty) by zadjii on Wednesday August 15, 2018 @08:45PM (#17771013)
Ah but see, now you're conflating two different things:

cmd.exe is a shell

conhost and cmder are terminals.

I believe cmder can come with git bash as well, which is also a shell.

The confusion comes from when you launch cmd, the window that appears by default is conhost, with cmd running attached to it. When you launch cmder, it's also running attached to cmd.

Re:Introducing the Windows Pseudo Console (ConPty) by nailer on Wednesday August 15, 2018 @05:14PM (#17769844)
The back end. Basically people like ConEmu and Hyper and Terminus have been having to use various unreliable hacks for ages because there was no real console API. Now there is one.