From 24b7a798270ba51edd88ed61c01782cbaf53472d Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Wed, 28 Feb 2024 12:44:09 +0100 Subject: [PATCH] Updated readme and examples --- README.md | 1 + examples/commands.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b68cd2e..2364bad 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ $ composer require noccylabs/react-shell:@dev ## Features * Interactive line-editing including arrow keys, home, end, delete and all the commodities you are used to. +* Automatic scrollback history, to avoid having to retype commands. * Input is edited on a single scrolling line. * Mostly Unicode-aware, meaning it will not have a nervous breakdown if you try to enter (single-width LTR) unicode characters. diff --git a/examples/commands.php b/examples/commands.php index b69ed8c..7402d2a 100644 --- a/examples/commands.php +++ b/examples/commands.php @@ -17,7 +17,7 @@ $commands->on('command', function ($command, $args, $shell) { $shell->write("Arguments passed: ".json_encode($args)."\n"); }); -$shell->on('prompt', function ($shell) { - $shell->setPrompt(date(">> ")); +$shell->on('prompt', function ($shell) { + $shell->setPrompt(">> "); }); $shell->on('input', $commands);