class

Icr::UnixLineEditor

Inherits Icr::LineEditor < Reference < Object

Unix adapter: termios raw mode, chunked reads fed through KeyParser, EditState mutated per event, prompt + buffer repainted after each key (cursor parked back where EditState says it belongs).

Constants

SEARCH_ROWS = 11

Constructors

new(input : IO::FileDescriptor = STDIN, output : IO = STDOUT, index : Icr::Completion::Index | Nil = nil)
Source

Instance methods

close

Restore the terminal the way the shell expects it.

Source
read_line(prompt : String, history : Array(String)) : String | Nil

Read one line, rendering prompt and walking history with ↑/↓. Returns nil on EOF (Ctrl+D on an empty line); Ctrl+C discards the line and returns "".

Source