class Termisu::Termios

Overview

Manages terminal attributes for raw mode operation.

Raw mode disables:

Defined in:

termisu/termios.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(fd : Int32) #

Creates a new Termios instance for the given file descriptor.

Parameters:

  • fd: File descriptor (typically STDIN.fd for terminal input)

[View source]

Instance Method Detail

def enable_raw_mode #

Enables raw mode on the terminal.

Saves current attributes and modifies terminal to disable:

  • Input processing and special character handling
  • Echo of typed characters
  • Canonical (line-buffered) mode
  • Signal generation from Ctrl+C, Ctrl+Z, etc.

[View source]
def restore #

Restores original terminal attributes saved during enable_raw_mode.

Safe to call even if enable_raw_mode was never called (no-op).


[View source]