gsh/command/history

The history module provides introspection into the REPL’s chronological execution log.

It allows users to review their past inputs, formatting the raw string history into a numbered, human-readable list for quick reference.

Values

pub fn show(history: List(String)) -> Nil

Renders a sequentially numbered list of all previously executed commands within the current active session.

Formatting Logic:

  • Iterates through the provided history list and prefixes each command with its chronological execution index (e.g., 1 let x = 5).
  • Safely handles fresh or recently cleared sessions by printing (empty).
Search Document