Giter Site home page Giter Site logo

zhiburt / conpty Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 5.0 103 KB

A Rust abstraction over ConPTY https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/

License: MIT License

Rust 99.84% Python 0.16%

conpty's People

Contributors

michaelvanstraten avatar zhiburt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

conpty's Issues

cant working on windows subsystem

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();
}

`ProcAttr::args()` has no effect

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.

Async support (tokio runtime)?

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?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.