nvim_runtime_lua

uv.uv_tty_t

uv_tty_t - TTY handle

[uv_handle_t][] and [uv_stream_t][] functions also apply.

TTY handles represent a stream for the console.

-- Simple echo program
local stdin = uv.new_tty(0, true)
local stdout = uv.new_tty(1, false)

stdin:read_start(function (err, data)
  assert(not err, err)
  if data then
    stdout:write(data)
  else
    stdin:close()
    stdout:close()
  end
end)

Methods2

function uv_tty_t.set_mode(mode: string | integer) -> (success 0 | nil, err nil | string, err_name uv.error_name | nil)

Set the TTY using the specified terminal mode.

See [Constants][] for supported TTY mode input values.

function uv_tty_t.get_winsize() -> (width nil | integer, height_or_err string | integer, err_name uv.error_name | nil)

Gets the current Window width and height.