package lambda-term

  1. Overview
  2. Docs
Terminal manipulation library for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

3.3.2.tar.gz
sha512=78648768644058337e22c79cf1fbb1a36472b24f11b1dc0461fc38419be6ec01b02d8d0ac45fed0bc99f91ba4c0f19d3bda113e834e064bee973b734527b9766

doc/lambda-term/LTerm_windows/index.html

Module LTerm_windowsSource

Windows specific functions

All these functions return Lwt_sys.Not_available on Unix.

Codepage functions
Sourceval get_acp : unit -> int

Returns the current ANSI codepage.

Sourceval get_console_cp : unit -> int

Returns the input codepage used by the console attached to the current process.

Sourceval set_console_cp : int -> unit

Sets the input codepage used by the console attached to the current process.

Sourceval get_console_output_cp : unit -> int

Returns the output codepage used by the console attached to the current process.

Sourceval set_console_output_cp : int -> unit

Sets the output codepage used by the console attached to the current process.

Console input
Sourcetype input =
  1. | Resize
  2. | Key of LTerm_key.t
  3. | Mouse of LTerm_mouse.t
Sourceval read_console_input : Lwt_unix.file_descr -> input Lwt.t

read_console_input fd reads one input from the given file descriptor.

Console info
Sourcetype text_attributes = {
  1. foreground : int;
    (*

    The foreground color. Only bits 0 to 3 matters, other are ignored.

    *)
  2. background : int;
    (*

    The background color. Only bits 0 to 3 matters, other are ignored.

    *)
}

Type of text attributes.

Sourcetype console_screen_buffer_info = {
  1. size : LTerm_geom.size;
    (*

    The size of the console buffer.

    *)
  2. cursor_position : LTerm_geom.coord;
    (*

    The line and column of the cursor.

    *)
  3. attributes : text_attributes;
    (*

    Text attributes.

    *)
  4. window : LTerm_geom.rect;
    (*

    The displayed windows in the console buffer.

    *)
  5. maximum_window_size : LTerm_geom.size;
    (*

    The maximum window size for the current screen.

    *)
}

Type of informations about a console.

Sourceval get_console_screen_buffer_info : Lwt_unix.file_descr -> console_screen_buffer_info

get_console_screen_buffer_info fd returns the current informations about the given console.

Console modes
Sourcetype console_mode = {
  1. cm_echo_input : bool;
  2. cm_insert_mode : bool;
  3. cm_line_input : bool;
  4. cm_mouse_input : bool;
  5. cm_processed_input : bool;
  6. cm_quick_edit_mode : bool;
  7. cm_window_input : bool;
}

Console modes.

Sourceval get_console_mode : Lwt_unix.file_descr -> console_mode

Returns the mode of the given console.

Sourceval set_console_mode : Lwt_unix.file_descr -> console_mode -> unit

Sets the mode of the given console.

Console cursor
Sourceval get_console_cursor_info : Lwt_unix.file_descr -> int * bool

Returns the size and visible status of the cursor on the given console. The size is a percentage between 1 and 100.

Sourceval set_console_cursor_info : Lwt_unix.file_descr -> int -> bool -> unit

set_console_cursor_info fd size visible sets the size and visible status of the cursor on the given console.

Sourceval set_console_cursor_position : Lwt_unix.file_descr -> LTerm_geom.coord -> unit

Move the cursor to the specified location in the screen buffer.

Text attributes
Sourceval set_console_text_attribute : Lwt_unix.file_descr -> text_attributes -> unit

set_console_text_attribute fd attributes

Rendering
Sourcetype char_info = {
  1. ci_char : Zed_char.t;
    (*

    The unicode character.

    *)
  2. ci_foreground : int;
    (*

    The foreground color.

    *)
  3. ci_background : int;
    (*

    The background color.

    *)
}

write_console_output fd chars size coord rect writes the given matrix of characters with their attributes on the given console at given position.

Sourceval fill_console_output_character : Lwt_unix.file_descr -> Uchar.t -> int -> LTerm_geom.coord -> int

fill_console_output_character fd char count coord writes count times char starting at coord on the given console.

OCaml

Innovation. Community. Security.