aymanbagabas / go-pty Goto Github PK
View Code? Open in Web Editor NEWCross platform Go Pty interface
License: MIT License
Cross platform Go Pty interface
License: MIT License
ConPTY is the formal successor to WinPTY
Hey, so I came across this and it looks like a really cool library (thanks for making it!), and I was hoping to use it in a project I'm working on.
Basically, what I'm trying to implement is very similar to your shell example, except that the example isn't behaving the way I expected it to. Essentially, I'm looking to use this package from a background service on my system, and have that background service spawn a pty that a user can connect to and use normally by running screen /dev/ttys002
or similar.
When I run the shell example though, it seems to effectively run it in my current TTY, which is obviously not too helpful in my case. It seems this might be intended given the code, particularly with regard to the io.Copy
routines reading/writing os.Stdout
/os.Stdin
, as well as the fact ptmx.Name()
isn't outputted at all.
Lines 37 to 47 in 0dbd56c
I tried to play with the arguments to the IO functions and replace os.Std*
with a handle to ptmx.Name()
, and that got the shell to seem to not use the current TTY, but I still can't seem to do anything at all inside the screen
connected to ptmx.Name()
. No data echos no matter what I type (stty
shows echo enabled though), and typing exit
doesn't seem to reach bash
because it doesn't exit.
I feel like I can't be far off at all from getting this to work, but I can't figure out what I'm missing. I'm also confused as to how the shell example was supposed to work in the first place. If you could point me in the right direction I'd really appreciate it.
Thanks so much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.