KinoTermite (Kino Termite v0.1.0)

View Source

KinoTermite provides xtermjs support for Termite so that it can be used inside of LiveBook.

To use it, create a cell with the following:

terminal = Termite.Terminal.start(adapter: KinoTermite.Adapter)
KinoTermite.output(terminal)

This will output the terminal.

In a separate code cell, code can be sent to the terminal

Termite.Screen.write(terminal, "This is a simple demo. Press q to exit.
")
loop = fn fun ->
  case Termite.Terminal.poll(terminal, 100) do
    {:data, "q"} -> Termite.Screen.write(terminal, "finished")
    :timeout -> Termite.Screen.write(terminal, "."); fun.(fun)
    _ -> fun.(fun)
  end
end

loop.(loop)

Summary

Functions

Output the Kino cell. This should be used in LiveBook to output the terminal

Functions

dimensions(kino)

new(opts)

output(map)

Output the Kino cell. This should be used in LiveBook to output the terminal

write(kino, str)