[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Operating a separate terminal under Lua control
- From: Daurnimator <quae@...>
- Date: Wed, 1 Mar 2017 01:58:15 +1100
On 1 March 2017 at 01:52, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> I thought this would work:
>
> $ lua
> Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio
>> term = io.popen('xterm -e "lua"',"w")
>> term:write"Some Lua input\n"
> file (0x1ef95f0)
>> term:close()
>
> After the first line, the new terminal appears. Encouraging.
> After the second line, nothing changes on the terminal,
> I thought it would pass my Lua input to it and run it.
> After the third line, MY terminal dies. Ctrl-C brings it back,
> killing the other terminal.
>
> What I want to do is to make the other terminal execute
> some Lua commands, as if I had been typing them in
> there.
>
> Am I trying the impossible or missing the obvious?
>
You need a pty library.
Try http://tset.de/lpty/index.html