Skip to content

Instantly share code, notes, and snippets.

View edubart's full-sized avatar

Eduardo Bart edubart

View GitHub Profile
local cartesi = require("cartesi")
local jsonrpc = require("cartesi.jsonrpc")
local poll = require("posix.poll")
local unistd = require("posix.unistd")
local termio = require("posix.termio")
local fcntl = require("posix.fcntl")
-- set terminal to raw mode
local ttyname = assert(unistd.ttyname())
local tty_fd = assert(fcntl.open(ttyname, fcntl.O_RDWR | fcntl.O_NOCTTY | fcntl.O_NONBLOCK))