Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice work! Is the work similar to vs-pty.net? #149

Open
bnuzhouwei opened this issue Oct 18, 2020 · 1 comment
Open

Nice work! Is the work similar to vs-pty.net? #149

bnuzhouwei opened this issue Oct 18, 2020 · 1 comment

Comments

@bnuzhouwei
Copy link

Is vs-pty.net the similar work to this job?
What can give a compare with the [vs-pty.net].
I am searching best solutions to make c# with a web pty.

@vandycknick
Copy link
Owner

I didn't even know about vs-pty.net, so thanks for showing me this. The main difference is that vs-pty is a library giving you some abstractions to create a pty cross-platform. Whereas webtty initially was developed to give an all in web pty/terminal solution. So in that case, vs-pty would be more comparable to some internals from webtty that I abstracted into a separate library. These projects try to solve the same problem but do it in a very different fashion and expose very different APIs. This project is similar to projects like gotty: https://github.com/yudai/gotty

A few more things I noticed form quickly skimming the codebase:

  • webtty only supports windows versions as of 1809, I never really found a good way to swap to something like winpty when running on windows before 1809 (which is when they added most API's for creating a pty on windows). But I am going to do some digging into that codebase to see if I can add support into webtty, so thanks again for showing me this.
  • Both suffer from the same issue in that they return a FileStream wrapped around the pty file descriptor for reading. This is a blocking API call even though it has async methods, the native API's under the hood will block. This is something you will need to take into account when using it in a web app that needs to scale accordingly. There are ways to avoid this blocking and is something I would love to implement if the time ever permits, but is not something I immediately need.
  • webtty in its current state is not really something to be used as a library. Mostly because my needs are more to use it as a CLI tool, but is something I have been thinking about and hoped to expose in WebTty.Hosting. But in its current state is simply not usable. Something like this is needed and a few other issues that I'm thinking about creating.

I hope this helps to answer your questions. As to your question about a good C# web pty library, at the moment this isn't going to be it. But is something I would love to address over the coming weeks if time permits, so if you have any input or feedback, that's always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants