class

Icr::LineEditor

Inherits Reference < Object

Constructors

new(completion : Icr::Completion::Index | Nil = nil) : LineEditor

The adapter for this platform and input: an interactive editor when stdin is a TTY, a plain gets otherwise. completion (when given) powers Tab completion and the Ctrl-T search overlay in the interactive adapter; the basic one ignores it.

Source

Instance methods

close

Release terminal state (restore cooked mode). No-op for adapters that never grabbed 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