Rewrite, cleanup and bugfixes

* More events added, constants cleaned up
* Events now handled using noccylabs/tinyevent
* Fixed magenta/cyan mixup in style
* Fixed LineRead not resetting history pointer on command
This commit is contained in:
2017-01-23 23:28:12 +01:00
parent b6727bed80
commit 5a45ca9c46
5 changed files with 119 additions and 72 deletions

View File

@ -2,6 +2,10 @@
namespace NoccyLabs\Shell;
/**
* This is a readline-like implementation in pure PHP.
*
*/
class LineRead
{
@ -127,6 +131,7 @@ class LineRead
array_unshift($this->history, $this->buffer);
$this->buffer = null;
$this->posCursor = 0;
$this->posHistory = 0;
printf("\n\r");
$this->state = self::STATE_IDLE;
}