Code Monkey home page Code Monkey logo

ptyknot's Introduction

ptyknot: Run a Rust action in a child process on a virtual terminal

Copyright (c) 2016 Bart Massey

This Rust "crate" provides support for creating a child process running a specified action, optionally with a new pseudo-tty as its controlling terminal and with parent pipes for some of its initial file descriptors. The caller gets the master side of the pseudo-tty and pipes for manipulation, along with the process ID of the child. The caller can then later wait for the child to exit and examine its exit status.

Documentation

The rustdoc is the primary documentation for this crate.

Issues

  • This library is quite Linux-specific.

    • It currently requires a Unix-98 ptmx pseudo-tty implementation: the older BSD-style pseudo-ttys are not yet supported.

    • It currently requires a SysV-style controlling terminal implementation that sets a controlling terminal on first tty open. The BSD-style ioctl to set a controlling terminal is not yet supported.

  • This code needs careful review. It's probably full of all kinds of badness.

Credits

This work initially borrowed from tty-rs. I only wrote this because I couldn't get that to work with current Rust in my box, and because I wanted slightly different functionality.

Specifically, I wrote this library to allow rewriting the it_works test in my reworked version of rpassword. rpassword has long since moved on, so…

Many sources of information were used in coding this. They are listed in the source code.

License

This work is made available under the "MIT License". Please see the file LICENSE in this distribution for license terms.

ptyknot's People

Contributors

bartmassey avatar

Stargazers

GAURAV avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

phdye

ptyknot's Issues

Investigate rewrite to std::process::command

Right now this does all its own fork-exec. It might be possible to just use std::process::command() instead, now that it's apparently debugged. This would remove a bunch of boilerplate and unsafety if it was possible to do.

drop(master) does nothing

Clippy found a bug where drop(master) was being used even though master was a reference to a file. I commented it out for now, but it needs to be investigated and maybe fixed. Look for the XXX comment in the source.

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.