lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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