TermColor.Repl.Terminal #
Small terminal primitives shared by REPL loops. Model state, rendering, and submission remain callbacks supplied by the application.
- token : Std.CancellationToken
Instances For
Equations
- TermColor.Repl.Terminal.Cancellation.new = do let __do_lift ← liftM Std.CancellationToken.new pure { token := __do_lift }
Instances For
Instances For
Equations
- token.isCancelled = liftM token.token.isCancelled
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
- result : IO.Ref (Option (Option Widgets.Key))
- signal : Std.Notify
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Configuration for cooperative background jobs.
Multiple submitted lines may run at the same time. The renderer remains the
owner of Model and Screen; each worker returns only model state which is
merged through finish when its result is drained.
- start : Model → String → Model
- run : Cancellation → Model → String → IO Model
- tick : Model → IO Model
Poll shared background state and advance live job presentation.
- finish : Model → Model → Model
- cancel : Model → Model
- fail : Model → String → Model
Instances For
Application keymaps #
Equations
- TermColor.Repl.Terminal.defaultFallbackSize = { columns := 80, rows := 24 }
Instances For
Equations
Instances For
- initial : Model
- inputConfig : Widgets.TextInputConfig
- multiline : Option MultilineConfig
- fallbackSize : Terminal.Size
- tickMs : UInt32
- resizeMs : UInt32
Deprecated compatibility field; resize checks now follow
tickMs. - editorKeymap : Option (Keymap EditorAction)
- mouse : Bool
- view : Model → Terminal.Size → Text
- complete : Model → Widgets.TextInputState → IO (List Completion)
Declarative application bindings. The first matching binding wins.
- handleKey : Model → Widgets.Key → Option Model
Handle an application-specific key before the REPL edits its input.
- handleMouse : Model → Terminal.Size → Terminal.MouseEvent → Option Model
Handle an application mouse event before the REPL ignores it.
- getState : Model → State
- setState : Model → State → Model
- isRunning : Model → Bool
- quit : Model → Model
Instances For
Equations
- TermColor.Repl.Terminal.currentSize fallback = do let __do_lift ← TermColor.Terminal.terminalSize pure (__do_lift.getD fallback)
Instances For
def
TermColor.Repl.Terminal.readKeyWithResize
(tickMs : UInt32)
(fallback : Terminal.Size)
(screen : Terminal.Screen)
(render : Terminal.Screen → IO Terminal.Screen)
(wake : IO Bool := pure false)
(reader : Option KeyReader := none)
(wakeSignal : Option Std.Notify := none)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.