zhiburt / conpty Goto Github PK
View Code? Open in Web Editor NEWA Rust abstraction over ConPTY https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
License: MIT License
A Rust abstraction over ConPTY https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
License: MIT License
I discovered conpty cant working when set #![windows_subsystem = "windows"]
. the following code will get the bug。
Error Message : Windows error : Invalid handle
#![windows_subsystem = "windows"]
use std::io::Write;
fn main() {
let proc = match conpty::spawn("cmd.exe"){
Ok(p) => p,
Err(e) => {
let mut f = std::fs::File::create("error.txt").unwrap();
f.write_all(format!("{}" ,e).as_bytes()).unwrap();
f.flush().unwrap();
return;
},
};
proc.wait(None).unwrap();
}
sticking with windows::Error might be not good decision
If a user sets the arguments for a program via ProcAttr::args()
or ProcAttr::arg()
, the arguments will not be used when spawning the process. This affects usage of expectrl
, as passing a Command
with arguments to Session::spawn()
will work on Unix but not on Windows.
Any chance the handles returned by Command::stdout() could be made async-capable? I spent a good deal of time seeing if I could somehow get them wrapped in a way that would allow tokio's AsyncReadBufExt-enabled structs to consume them, but my knowledge of futures internals is limited and it seems like conpty
might be using a slightly different set of underlying types than tokio expects on Windows (HANDLE seems to be defined differently for some reason?)
There's no reason to provide these function by default.
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.