NAME
Tickit::Terminal::Prompt - a scrolling terminal command prompt
SYNOPSIS
my $ui = Tickit::Terminal::Prompt->new(
prompt => 'demo> ',
on_enter => sub ($ui, $line) { $ui->say("Input: $line") },
);
$ui->run;
DESCRIPTION
Displays output in a scroller and a command entry on the next line. The callback receives the console object and the entered text without its prompt. The application decides how to interpret that text. The constructor owns an IO::Async loop and a Tickit::Async instance; call run to start the UI.
METHODS
new
Requires on_enter => sub ($ui, $line) { ... }. The optional prompt defaults to >. Prompts must fit on one line.
print, say
Append text to the scroller. say adds a newline. Calls to print without a newline continue the current output line.
set_prompt
Replace the prompt while retaining any command currently being edited.
run, stop
Start or stop the event loop. stop scrolls to the bottom, lets the final redraw complete, and places the terminal cursor on the bottom row before stopping. After Tickit restores the terminal, run flushes and prints a newline so the shell prompt appears on the next line. Ctrl-C calls stop.
AUTHOR
Joel Roth <joelz@pobox.com>
LICENSE
Copyright (C) 2026 Joel Roth. Distributed under the Artistic License 2.0.