[ANN] lpty 1.0

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] lpty 1.0

Gunnar Zötl
Hi,

this message is to announce the availability of lpty 1.0. lpty is a simple
interface to pty functionality, providing the ability to fork a process and run
it under pty control. It does not try to mimic the posix API but instead focuses
on the function of running and controlling a program.

New since version 0.9:

- does not register a global table "lpty" on loading any more, because it is
now...
- compatible with lua 5.1 and 5.2
- new exitstatus() method, which can provide information about why a child
process terminated
- new flush() method, that removes unwanted data from the pty
- custom environments for processes, and 2 new methods to deal with those
- an option on pty creation time to start child processes using the contents of
the PATH environment variable - or not
- the makefile has been made somewhat more usable
- the documentation has received a makeover

You can get lpty from http://www.tset.de/lpty

or via luarocks install lpty.

Rgds,

Gunnar

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Xavier Wang
Great work!

I'm working on Windows, can windows support pty anyway :-(

2013/4/2 "Gunnar Zötl" <[hidden email]>:

> Hi,
>
> this message is to announce the availability of lpty 1.0. lpty is a simple
> interface to pty functionality, providing the ability to fork a process and run
> it under pty control. It does not try to mimic the posix API but instead focuses
> on the function of running and controlling a program.
>
> New since version 0.9:
>
> - does not register a global table "lpty" on loading any more, because it is
> now...
> - compatible with lua 5.1 and 5.2
> - new exitstatus() method, which can provide information about why a child
> process terminated
> - new flush() method, that removes unwanted data from the pty
> - custom environments for processes, and 2 new methods to deal with those
> - an option on pty creation time to start child processes using the contents of
> the PATH environment variable - or not
> - the makefile has been made somewhat more usable
> - the documentation has received a makeover
>
> You can get lpty from http://www.tset.de/lpty
>
> or via luarocks install lpty.
>
> Rgds,
>
> Gunnar
>



--
regards,
Xavier Wang.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

steve donovan
On Tue, Apr 2, 2013 at 9:42 AM, Xavier Wang <[hidden email]> wrote:
I'm working on Windows, can windows support pty anyway :-(

Windows is always ... different.  You can get similar functionality from the winapi module , i.e. you can run an interactive process and capture its standout i/o streams. However, some Windows programs (like ftp) use direct console i/o for entering passwords and that messes up the nice model...

(http://stevedonovan.github.com/winapi/topics/readme.md.html)

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Xavier Wang
I'm using winapi all the time, it's a great modulle :)

but some windows program use isatty, but if you use redirect, isatty
always return 0, so I want to find some way to work out this...

2013/4/2 steve donovan <[hidden email]>:

> On Tue, Apr 2, 2013 at 9:42 AM, Xavier Wang <[hidden email]> wrote:
>>
>> I'm working on Windows, can windows support pty anyway :-(
>
>
> Windows is always ... different.  You can get similar functionality from the
> winapi module , i.e. you can run an interactive process and capture its
> standout i/o streams. However, some Windows programs (like ftp) use direct
> console i/o for entering passwords and that messes up the nice model...
>
> (http://stevedonovan.github.com/winapi/topics/readme.md.html)
>



--
regards,
Xavier Wang.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Gunnar Zötl
sorry, lpty is Un*x only. I don't think windows really has a concept like a
pty...

Xavier Wang <[hidden email]> hat am 2. April 2013 um 09:56 geschrieben:

> I'm using winapi all the time, it's a great modulle :)
>
> but some windows program use isatty, but if you use redirect, isatty
> always return 0, so I want to find some way to work out this...
>
> 2013/4/2 steve donovan <[hidden email]>:
> > On Tue, Apr 2, 2013 at 9:42 AM, Xavier Wang <[hidden email]> wrote:
> >>
> >> I'm working on Windows, can windows support pty anyway :-(
> >
> >
> > Windows is always ... different.  You can get similar functionality from the
> > winapi module , i.e. you can run an interactive process and capture its
> > standout i/o streams. However, some Windows programs (like ftp) use direct
> > console i/o for entering passwords and that messes up the nice model...
> >
> > (http://stevedonovan.github.com/winapi/topics/readme.md.html)
> >
>
>
>
> --
> regards,
> Xavier Wang.
>

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Matthew Wild
In reply to this post by Gunnar Zötl
On 2 April 2013 08:14, "Gunnar Zötl" <[hidden email]> wrote:
> Hi,
>
> this message is to announce the availability of lpty 1.0. lpty is a simple
> interface to pty functionality, providing the ability to fork a process and run
> it under pty control. It does not try to mimic the posix API but instead focuses
> on the function of running and controlling a program.
>

Thanks! lpty is my favourite sub-process management module from those
I've used so far. Keep up the good work.

Regards,
Matthew

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Egil Hjelmeland
In reply to this post by Gunnar Zötl
If there was a  pty:getfd() method, it could be possible to multiplex
master ptys using socket.select() ?

Egil


PS: This trick allow passing io.stdin to socket.select()

getmetatable ( io.stdin ).getfd = function(fh)
         if fh == io.stdin then return 0 end
end



On 02. april 2013 09:14, "Gunnar Zötl" wrote:

> Hi,
>
> this message is to announce the availability of lpty 1.0. lpty is a simple
> interface to pty functionality, providing the ability to fork a process and run
> it under pty control. It does not try to mimic the posix API but instead focuses
> on the function of running and controlling a program.
>
> New since version 0.9:
>
> - does not register a global table "lpty" on loading any more, because it is
> now...
> - compatible with lua 5.1 and 5.2
> - new exitstatus() method, which can provide information about why a child
> process terminated
> - new flush() method, that removes unwanted data from the pty
> - custom environments for processes, and 2 new methods to deal with those
> - an option on pty creation time to start child processes using the contents of
> the PATH environment variable - or not
> - the makefile has been made somewhat more usable
> - the documentation has received a makeover
>
> You can get lpty from http://www.tset.de/lpty
>
> or via luarocks install lpty.
>
> Rgds,
>
> Gunnar
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Gunnar Zötl


Egil Hjelmeland <[hidden email]> hat am 4. April 2013 um 00:00
geschrieben:
> If there was a  pty:getfd() method, it could be possible to multiplex
> master ptys using socket.select() ?

yes, that might be a good idea. I'll think about it for the next version.

Thanks,

Gunnar

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Philippe Lhoste
In reply to this post by Gunnar Zötl
On 02/04/2013 10:03, "Gunnar Zötl" wrote:
> sorry, lpty is Un*x only. I don't think windows really has a concept like a
> pty...

That's a PiTY, for sure...
(Says one not knowing what pty is about before this announcement, which assumes, probably
rightfully, a knowledge of what it is...)

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] lpty 1.0

Gunnar Zötl
http://en.wikipedia.org/wiki/Pseudo_terminal

:)

Gunnar

Philippe Lhoste <[hidden email]> hat am 10. April 2013 um 17:24 geschrieben:

> On 02/04/2013 10:03, "Gunnar Zötl" wrote:
> > sorry, lpty is Un*x only. I don't think windows really has a concept like a
> > pty...
>
> That's a PiTY, for sure...
> (Says one not knowing what pty is about before this announcement, which
> assumes, probably
> rightfully, a knowledge of what it is...)
>
> --
> Philippe Lhoste
> --  (near) Paris -- France
> --  http://Phi.Lho.free.fr
> --  --  --  --  --  --  --  --  --  --  --  --  --  --
>
>