package terml

  1. Overview
  2. Docs
val stdin_fd : Unix.file_descr
type clear_type =
  1. | All
  2. | Purge
  3. | FromCursorDown
  4. | FromCursorUp
  5. | CurrentLine
  6. | UntilNewLine
type t =
  1. | DisableLineWrap
  2. | EnableLineWrap
  3. | EnterAlternateScreen
  4. | LeaveAlternateScreen
  5. | ScrollUp of int
  6. | ScrollDown of int
  7. | SetSize of int * int
  8. | SetTitle of string
  9. | BeginSyncUpdate
  10. | EndSyncUpdate
  11. | ClearScreen of clear_type
type window_size = {
  1. rows : int;
  2. cols : int;
  3. width : int;
  4. height : int;
}
val disable_line_wrap : string

Disables line wrapping.

val enable_line_wrap : string

Enables line wrapping.

val enter_alternate_screen : string

A command that switches to the alternate screen buffer.

val leave_alternate_screen : string

A command that switches back from the alternate screen buffer.

val scroll_up : int -> string

A command that scrolls the terminal up a given number of rows.

val scroll_down : int -> string

A command that scrolls the terminal down a given number of rows.

val set_size : int -> int -> string

A command that sets the terminal buffer size (columns, rows).

val set_title : string -> string

A command that sets the terminal title.

val begin_sync_update : string

A command that tells the terminal to begin a synchronous update.

Terminal emulators usually iterates through each grid cell in the visible screen and renders its current state. Applications that updates the screen at a higher frequency can experience tearing.

When a synchronous update is enabled, the terminal will keep rendering the previous frame until the application is ready to render the next frame.

Disabling synchronous update will cause the terminal to render the screen as soon as possible.

val end_sync_update : string

A command that tells the terminal to end a synchronous update.

Terminal emulators usually iterates through each grid cell in the visible screen and renders its current state. Applications that updates the screen at a higher frequency can experience tearing.

When a synchronous update is enabled, the terminal will keep rendering the previous frame until the application is ready to render the next frame.

Disabling synchronous update will cause the terminal to render the screen as soon as possible.

val clear_screen : clear_type -> string

A command that clears the terminal screen buffer. clear_type specifies the type of clear to perform.

  • All clears the entire screen.
  • Purge clears the entire screen and the scrollback buffer. (history)
  • FromCursorDown clears from the cursor to the end of the screen.
  • FromCursorUp clears from the cursor to the beginning of the screen.
  • CurrentLine clears the current line.
  • UntilNewLine clears from the cursor until the new line.
val enable_raw_mode : unit -> Unix.terminal_io

Enable raw mode for the current terminal. Returns the previous terminal settings so that they can be restored later.

val disable_raw_mode : Unix.terminal_io -> unit

Disables raw mode for the current terminal. termios is the terminal settings that were previously saved by enable_raw_mode.

val execute : t -> string
OCaml

Innovation. Community. Security.